We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5bdfdc commit 5f140baCopy full SHA for 5f140ba
src/uucore/src/lib/mods/clap_localization.rs
@@ -479,13 +479,13 @@ where
479
I: IntoIterator<Item = T>,
480
T: Into<OsString> + Clone,
481
{
482
- match cmd.try_get_matches_from(itr) {
483
- Ok(matches) => Ok(matches),
484
- Err(e) if e.exit_code() == 0 => Err(e.into()), // Preserve help/version
485
- Err(e) => {
486
- handle_clap_error_with_exit_code(e, exit_code);
+ cmd.try_get_matches_from(itr).map_err(|e| {
+ if e.exit_code() == 0 {
+ e.into() // Preserve help/version
+ } else {
+ handle_clap_error_with_exit_code(e, exit_code)
487
}
488
- }
+ })
489
490
491
/// Handles a clap error directly with a custom exit code.
0 commit comments