File tree 5 files changed +11
-13
lines changed
5 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub fn cli() -> Command {
30
30
)
31
31
. arg_features ( )
32
32
. arg_release ( "Build artifacts in release mode, with optimizations" )
33
- . arg_unsupported_mode ( "debug" , "build" , "release" )
33
+ . arg_redundant_default_mode ( "debug" , "build" , "release" )
34
34
. arg_profile ( "Build artifacts with the specified profile" )
35
35
. arg_parallel ( )
36
36
. arg_target_triple ( "Build for the target triple" )
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ pub fn cli() -> Command {
83
83
"debug" ,
84
84
"Build in debug mode (with the 'dev' profile) instead of release mode" ,
85
85
) )
86
- . arg_unsupported_mode ( "release" , "install" , "debug" )
86
+ . arg_redundant_default_mode ( "release" , "install" , "debug" )
87
87
. arg_profile ( "Install artifacts with the specified profile" )
88
88
. arg_target_triple ( "Build for the target triple" )
89
89
. arg_target_dir ( )
Original file line number Diff line number Diff line change @@ -112,17 +112,15 @@ pub trait CommandExt: Sized {
112
112
self . _arg ( flag ( "keep-going" , "" ) . value_parser ( value_parser) . hide ( true ) )
113
113
}
114
114
115
- fn arg_unsupported_mode (
115
+ fn arg_redundant_default_mode (
116
116
self ,
117
- want : & ' static str ,
117
+ default_mode : & ' static str ,
118
118
command : & ' static str ,
119
- actual : & ' static str ,
119
+ supported_mode : & ' static str ,
120
120
) -> Self {
121
- let msg = format ! (
122
- "There is no `--{want}` for `cargo {command}`. Only `--{actual}` is supported."
123
- ) ;
121
+ let msg = format ! ( "`--{default_mode}` is the default for `cargo {command}`; instead `--{supported_mode}` is supported" ) ;
124
122
let value_parser = UnknownArgumentValueParser :: suggest ( msg) ;
125
- self . _arg ( flag ( want , "" ) . value_parser ( value_parser) . hide ( true ) )
123
+ self . _arg ( flag ( default_mode , "" ) . value_parser ( value_parser) . hide ( true ) )
126
124
}
127
125
128
126
fn arg_targets_all (
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ fn incremental_config() {
136
136
}
137
137
138
138
#[ cargo_test]
139
- fn cargo_compile_with_unsupported_mode ( ) {
139
+ fn cargo_compile_with_redundant_default_mode ( ) {
140
140
let p = project ( )
141
141
. file ( "Cargo.toml" , & basic_bin_manifest ( "foo" ) )
142
142
. file ( "src/foo.rs" , & main_file ( r#""i am foo""# , & [ ] ) )
@@ -147,7 +147,7 @@ fn cargo_compile_with_unsupported_mode() {
147
147
"\
148
148
error: unexpected argument '--debug' found
149
149
150
- tip: There is no `--debug` for `cargo build`. Only `--release` is supported.
150
+ tip: `--debug` is the default for `cargo build`; instead `--release` is supported
151
151
152
152
Usage: cargo[EXE] build [OPTIONS]
153
153
Original file line number Diff line number Diff line change @@ -2445,15 +2445,15 @@ fn ambiguous_registry_vs_local_package() {
2445
2445
}
2446
2446
2447
2447
#[ cargo_test]
2448
- fn install_with_unsupported_mode ( ) {
2448
+ fn install_with_redundant_default_mode ( ) {
2449
2449
pkg ( "foo" , "0.0.1" ) ;
2450
2450
2451
2451
cargo_process ( "install foo --release" )
2452
2452
. with_stderr (
2453
2453
"\
2454
2454
error: unexpected argument '--release' found
2455
2455
2456
- tip: There is no `--release` for `cargo install`. Only `--debug` is supported.
2456
+ tip: `--release` is the default for `cargo install`; instead `--debug` is supported
2457
2457
2458
2458
Usage: cargo[EXE] install [OPTIONS] [crate]...
2459
2459
You can’t perform that action at this time.
0 commit comments