File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -94,15 +94,22 @@ pub fn main() -> Result<utils::ExitCode> {
9494 }
9595 return Ok ( utils:: ExitCode ( 0 ) ) ;
9696 }
97- Err ( clap:: Error {
98- kind : MissingArgumentOrSubcommand ,
99- message,
100- ..
101- } ) => {
102- writeln ! ( process( ) . stdout( ) . lock( ) , "{}" , message) ?;
103- return Ok ( utils:: ExitCode ( 1 ) ) ;
104- }
105- Err ( e) => Err ( e) ,
97+
98+ Err ( e) => match & e {
99+ clap:: Error { kind, message, .. } => {
100+ if [
101+ InvalidSubcommand ,
102+ UnknownArgument ,
103+ MissingArgumentOrSubcommand ,
104+ ]
105+ . contains ( kind)
106+ {
107+ writeln ! ( process( ) . stdout( ) . lock( ) , "{}" , message) ?;
108+ return Ok ( utils:: ExitCode ( 1 ) ) ;
109+ }
110+ Err ( e)
111+ }
112+ } ,
106113 } ?;
107114 let verbose = matches. is_present ( "verbose" ) ;
108115 let quiet = matches. is_present ( "quiet" ) ;
You can’t perform that action at this time.
0 commit comments