Skip to content

Commit 62f82ef

Browse files
committed
uucore/clap_l10n: move exit outside match
1 parent b06799d commit 62f82ef

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/uucore/src/lib/mods/clap_localization.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,16 @@ fn handle_display_errors(err: Error) -> ! {
9393
let usage_label = translate!("common-usage");
9494
let localized_help = help_text.replace("Usage:", &format!("{usage_label}:"));
9595

96-
print!("{}", localized_help);
97-
std::process::exit(0);
96+
print!("{localized_help}");
9897
}
9998
ErrorKind::DisplayVersion => {
10099
// For version, use clap's built-in formatting and exit with 0
101100
// Output to stdout as expected by tests
102101
print!("{}", err.render());
103-
std::process::exit(0);
104102
}
105103
_ => unreachable!("handle_display_errors called with non-display error"),
106104
}
105+
std::process::exit(0);
107106
}
108107

109108
/// Handle UnknownArgument errors with localization and suggestions

0 commit comments

Comments
 (0)