mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
uucore/clap_l10n: move exit outside match
This commit is contained in:
@@ -93,17 +93,16 @@ fn handle_display_errors(err: Error) -> ! {
|
||||
let usage_label = translate!("common-usage");
|
||||
let localized_help = help_text.replace("Usage:", &format!("{usage_label}:"));
|
||||
|
||||
print!("{}", localized_help);
|
||||
std::process::exit(0);
|
||||
print!("{localized_help}");
|
||||
}
|
||||
ErrorKind::DisplayVersion => {
|
||||
// For version, use clap's built-in formatting and exit with 0
|
||||
// Output to stdout as expected by tests
|
||||
print!("{}", err.render());
|
||||
std::process::exit(0);
|
||||
}
|
||||
_ => unreachable!("handle_display_errors called with non-display error"),
|
||||
}
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
||||
/// Handle UnknownArgument errors with localization and suggestions
|
||||
|
||||
Reference in New Issue
Block a user