Clearer error processing

This commit is contained in:
Donough Liu 2020-12-29 17:38:43 +08:00 committed by ldm0
parent 8f4c26fc58
commit c6bcfe819e

View file

@ -592,7 +592,7 @@ impl<'help, 'app> Parser<'help, 'app> {
self.app.color(), self.app.color(),
)); ));
} }
} else { }
let cands = suggestions::did_you_mean( let cands = suggestions::did_you_mean(
&arg_os.to_string_lossy(), &arg_os.to_string_lossy(),
self.app.all_subcommand_names(), self.app.all_subcommand_names(),
@ -627,7 +627,6 @@ impl<'help, 'app> Parser<'help, 'app> {
self.app.color(), self.app.color(),
)); ));
} }
}
return Err(ClapError::unknown_argument( return Err(ClapError::unknown_argument(
arg_os.to_string_lossy().to_string(), arg_os.to_string_lossy().to_string(),
None, None,