@@ -74,7 +74,13 @@ pub fn main(gctx: &mut GlobalContext) -> CliResult {
74
74
}
75
75
} ;
76
76
let exec = Exec :: infer ( cmd) ?;
77
- config_configure ( gctx, & expanded_args, subcommand_args, global_args, & exec) ?;
77
+ config_configure (
78
+ gctx,
79
+ & expanded_args,
80
+ Some ( subcommand_args) ,
81
+ global_args,
82
+ Some ( & exec) ,
83
+ ) ?;
78
84
super :: init_git ( gctx) ;
79
85
80
86
exec. exec ( gctx, subcommand_args) ?;
@@ -365,16 +371,18 @@ For more information, see issue #12207 <https://github.com/rust-lang/cargo/issue
365
371
fn config_configure (
366
372
gctx : & mut GlobalContext ,
367
373
args : & ArgMatches ,
368
- subcommand_args : & ArgMatches ,
374
+ subcommand_args : Option < & ArgMatches > ,
369
375
global_args : GlobalArgs ,
370
- exec : & Exec ,
376
+ exec : Option < & Exec > ,
371
377
) -> CliResult {
372
- let arg_target_dir = & subcommand_args. value_of_path ( "target-dir" , gctx) ;
378
+ let arg_target_dir = & subcommand_args. and_then ( |a| a . value_of_path ( "target-dir" , gctx) ) ;
373
379
let mut verbose = global_args. verbose + args. verbose ( ) ;
374
380
// quiet is unusual because it is redefined in some subcommands in order
375
381
// to provide custom help text.
376
- let mut quiet = args. flag ( "quiet" ) || subcommand_args. flag ( "quiet" ) || global_args. quiet ;
377
- if matches ! ( exec, Exec :: Manifest ( _) ) && !quiet {
382
+ let mut quiet = args. flag ( "quiet" )
383
+ || subcommand_args. map ( |a| a. flag ( "quiet" ) ) . unwrap_or_default ( )
384
+ || global_args. quiet ;
385
+ if matches ! ( exec, Some ( Exec :: Manifest ( _) ) ) && !quiet {
378
386
// Verbosity is shifted quieter for `Exec::Manifest` as it is can be used as if you ran
379
387
// `cargo install` and we especially shouldn't pollute programmatic output.
380
388
//
0 commit comments