fix #2696: avoid 'undefined value' warning in 'pvesh help unknown'
authorStefan Reiter <s.reiter@proxmox.com>
Mon, 4 May 2020 12:02:47 +0000 (14:02 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 May 2020 16:05:50 +0000 (18:05 +0200)
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
src/PVE/CLIHandler.pm

index 763cd60850c7da3fbee1a74ea7e816b0cd9b850b..9955d77e06395c85dd219dac7d9f322bc1824992 100644 (file)
@@ -235,8 +235,8 @@ sub generate_usage_str {
 
            }
        } else {
+           $abort->("unknown command '$cmd->[0]'") if !$def;
            my ($class, $name, $arg_param, $fixed_param, undef, $formatter_properties) = @$def;
-           $abort->("unknown command '$cmd'") if !$class;
 
            $str .= $indent;
            $str .= $class->usage_str($name, $prefix, $arg_param, $fixed_param, $format, $param_cb, $formatter_properties);