]> git.proxmox.com Git - pve-common.git/commitdiff
generate_usage_str: show short usage help for unknown commands
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 13 Jun 2018 06:30:35 +0000 (08:30 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 13 Jun 2018 06:31:25 +0000 (08:31 +0200)
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 <t.lamprecht@proxmox.com>
src/PVE/CLIHandler.pm

index 5cdffa33d978a3a9b9e30160b479f94fd47b4b92..9bbc15627bff5a385d4198fc80b77e643b3b81d4 100644 (file)
@@ -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 {