From 24ccf353c76bcb346bf86761358b638e3105e298 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 13 Jun 2018 08:30:35 +0200 Subject: [PATCH] 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 --- src/PVE/CLIHandler.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- 2.39.2