File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -134,19 +134,17 @@ fn parse_cli(raw_args: Vec<String>) -> Result<cli::Cli, clap::Error> {
134134}
135135
136136fn should_default_to_build ( err : & clap:: Error , args : & [ String ] ) -> bool {
137- let first_non_global = first_non_global_arg ( args) ;
138-
139137 match err. kind ( ) {
140- ErrorKind :: MissingSubcommand | ErrorKind :: DisplayHelpOnMissingArgumentOrSubcommand => {
138+ ErrorKind :: MissingSubcommand
139+ | ErrorKind :: DisplayHelpOnMissingArgumentOrSubcommand
140+ | ErrorKind :: UnknownArgument
141+ | ErrorKind :: InvalidSubcommand => {
142+ let first_non_global = first_non_global_arg ( args) ;
141143 match first_non_global {
142144 Some ( arg) => !is_known_subcommand ( arg) ,
143145 None => true ,
144146 }
145147 }
146- ErrorKind :: UnknownArgument | ErrorKind :: InvalidSubcommand => match first_non_global {
147- Some ( arg) if is_known_subcommand ( arg) => false ,
148- _ => true ,
149- } ,
150148 _ => false ,
151149 }
152150}
You can’t perform that action at this time.
0 commit comments