@@ -892,7 +892,6 @@ impl Config {
892892 self . unstable_flags_cli = Some ( unstable_flags. to_vec ( ) ) ;
893893 }
894894 if !cli_config. is_empty ( ) {
895- self . unstable_flags . fail_if_stable_opt ( "--config" , 6699 ) ?;
896895 self . cli_config = Some ( cli_config. iter ( ) . map ( |s| s. to_string ( ) ) . collect ( ) ) ;
897896 self . merge_cli_args ( ) ?;
898897 }
@@ -1165,6 +1164,7 @@ impl Config {
11651164 Some ( cli_args) => cli_args,
11661165 None => return Ok ( loaded_args) ,
11671166 } ;
1167+ let mut seen = HashSet :: new ( ) ;
11681168 for arg in cli_args {
11691169 let arg_as_path = self . cwd . join ( arg) ;
11701170 let tmp_table = if !arg. is_empty ( ) && arg_as_path. exists ( ) {
@@ -1175,9 +1175,8 @@ impl Config {
11751175 anyhow:: format_err!( "config path {:?} is not utf-8" , arg_as_path)
11761176 } ) ?
11771177 . to_string ( ) ;
1178- let value = CV :: String ( str_path, Definition :: Cli ) ;
1179- let map = HashMap :: from ( [ ( "include" . to_string ( ) , value) ] ) ;
1180- CV :: Table ( map, Definition :: Cli )
1178+ self . _load_file ( & self . cwd ( ) . join ( & str_path) , & mut seen, true )
1179+ . with_context ( || format ! ( "failed to load config from `{}`" , str_path) ) ?
11811180 } else {
11821181 // We only want to allow "dotted key" (see https://toml.io/en/v1.0.0#keys)
11831182 // expressions followed by a value that's not an "inline table"
0 commit comments