File tree 3 files changed +24
-9
lines changed
3 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -35,14 +35,7 @@ pub fn cli() -> Command {
35
35
. arg_parallel ( )
36
36
. arg_target_triple ( "Build for the target triple" )
37
37
. arg_target_dir ( )
38
- . arg (
39
- opt (
40
- "out-dir" ,
41
- "Copy final artifacts to this directory (unstable)" ,
42
- )
43
- . value_name ( "PATH" )
44
- . help_heading ( heading:: COMPILATION_OPTIONS ) ,
45
- )
38
+ . arg_out_dir ( )
46
39
. arg_build_plan ( )
47
40
. arg_unit_graph ( )
48
41
. arg_timings ( )
Original file line number Diff line number Diff line change @@ -357,6 +357,26 @@ pub trait CommandExt: Sized {
357
357
. help_heading ( heading:: COMPILATION_OPTIONS ) ,
358
358
)
359
359
}
360
+
361
+ fn arg_out_dir ( self ) -> Self {
362
+ let unsupported_short_arg = {
363
+ let msg = format ! ( "no short alias is defined for `--out-dir`" ) ;
364
+ let value_parser = UnknownArgumentValueParser :: suggest ( msg) ;
365
+ flag ( "unsupported-short-out-dir-flag" , "" )
366
+ . short ( 'O' )
367
+ . value_parser ( value_parser)
368
+ . hide ( true )
369
+ } ;
370
+ self . _arg (
371
+ opt (
372
+ "out-dir" ,
373
+ "Copy final artifacts to this directory (unstable)" ,
374
+ )
375
+ . value_name ( "PATH" )
376
+ . help_heading ( heading:: COMPILATION_OPTIONS ) ,
377
+ )
378
+ . _arg ( unsupported_short_arg)
379
+ }
360
380
}
361
381
362
382
impl CommandExt for Command {
Original file line number Diff line number Diff line change @@ -291,7 +291,9 @@ fn unsupported_short_out_dir_flag() {
291
291
. masquerade_as_nightly_cargo ( & [ "out-dir" ] )
292
292
. with_stderr (
293
293
"\
294
- error: unexpected argument '-O' found
294
+ error: unexpected argument '--unsupported-short-out-dir-flag' found
295
+
296
+ tip: a similar argument exists: '--out-dir'
295
297
296
298
Usage: cargo[EXE] build [OPTIONS]
297
299
You can’t perform that action at this time.
0 commit comments