@@ -2,7 +2,7 @@ use anyhow::{anyhow, Context as _};
22use cargo:: core:: shell:: Shell ;
33use cargo:: core:: { features, CliUnstable } ;
44use cargo:: { self , drop_print, drop_println, CargoResult , CliResult , Config } ;
5- use clap:: { Arg , ArgMatches } ;
5+ use clap:: { builder :: UnknownArgumentValueParser , Arg , ArgMatches } ;
66use itertools:: Itertools ;
77use std:: collections:: HashMap ;
88use std:: ffi:: OsStr ;
@@ -618,8 +618,29 @@ See '<cyan,bold>cargo help</> <cyan><<command>></>' for more information on a sp
618618 . help_heading ( heading:: MANIFEST_OPTIONS )
619619 . global ( true ) ,
620620 )
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 ) )
623644 . subcommands ( commands:: builtin ( ) )
624645}
625646
0 commit comments