@@ -2,7 +2,7 @@ use anyhow::{anyhow, Context as _};
2
2
use cargo:: core:: shell:: Shell ;
3
3
use cargo:: core:: { features, CliUnstable } ;
4
4
use cargo:: { self , drop_print, drop_println, CargoResult , CliResult , Config } ;
5
- use clap:: { Arg , ArgMatches } ;
5
+ use clap:: { builder :: UnknownArgumentValueParser , Arg , ArgMatches } ;
6
6
use itertools:: Itertools ;
7
7
use std:: collections:: HashMap ;
8
8
use std:: ffi:: OsStr ;
@@ -618,8 +618,29 @@ See '<cyan,bold>cargo help</> <cyan><<command>></>' for more information on a sp
618
618
. help_heading ( heading:: MANIFEST_OPTIONS )
619
619
. global ( true ) ,
620
620
)
621
- . arg_config ( )
622
- . arg_unstable_feature ( )
621
+ // Better suggestion for the unsupported short config flag.
622
+ . arg ( Arg :: new ( "unsupported-short-config-flag" )
623
+ . help ( "" )
624
+ . short ( 'c' )
625
+ . value_parser ( UnknownArgumentValueParser :: suggest_arg ( "--config" ) )
626
+ . action ( ArgAction :: SetTrue )
627
+ . global ( true )
628
+ . hide ( true ) )
629
+ . arg ( multi_opt ( "config" , "KEY=VALUE" , "Override a configuration value" ) . global ( true ) )
630
+ // Better suggestion for the unsupported lowercase unstable feature flag.
631
+ . arg ( Arg :: new ( "unsupported-lowercase-unstable-feature-flag" )
632
+ . help ( "" )
633
+ . short ( 'z' )
634
+ . value_parser ( UnknownArgumentValueParser :: suggest_arg ( "-Z" ) )
635
+ . action ( ArgAction :: SetTrue )
636
+ . global ( true )
637
+ . hide ( true ) )
638
+ . arg ( Arg :: new ( "unstable-features" )
639
+ . help ( "Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details" )
640
+ . short ( 'Z' )
641
+ . value_name ( "FLAG" )
642
+ . action ( ArgAction :: Append )
643
+ . global ( true ) )
623
644
. subcommands ( commands:: builtin ( ) )
624
645
}
625
646
0 commit comments