From: Thomas Lamprecht Date: Wed, 13 Jun 2018 06:30:35 +0000 (+0200) Subject: generate_usage_str: show short usage help for unknown commands X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=24ccf353c76bcb346bf86761358b638e3105e298;ds=sidebyside generate_usage_str: show short usage help for unknown commands followup for previous commit to show the full short usage string for the CLI tool in the case of an unknown command Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index 5cdffa3..9bbc156 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -132,7 +132,7 @@ sub generate_usage_str { $cli_handler_class->can('string_param_file_mapping'); my ($subcmd, $def, undef, undef, $cmdstr) = resolve_cmd($cmd); - die "no such command '$cmd->[0]'\n" if !defined($def) && ref($cmd) eq 'ARRAY'; + $abort->("unknown command '$cmdstr'") if !defined($def) && ref($cmd) eq 'ARRAY'; my $generate; $generate = sub {