cli::command: wrap usage errors in a UsageError
So we can distinguish them and show usage output conditionally. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
@ -146,7 +146,9 @@ fn main() {
|
||||
|
||||
if let Err(err) = run_cli_command(&cmd_def.into()) {
|
||||
eprintln!("Error: {}", err);
|
||||
print_cli_usage();
|
||||
if err.downcast::<UsageError>().is_ok() {
|
||||
print_cli_usage();
|
||||
}
|
||||
std::process::exit(-1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user