[pve-devel] [PATCH common] fix #2696: avoid 'undefined value' warning in 'pvesh help'

Stefan Reiter s.reiter at proxmox.com
Mon May 4 14:02:47 CEST 2020


Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 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 763cd60..9955d77 100644
--- a/src/PVE/CLIHandler.pm
+++ b/src/PVE/CLIHandler.pm
@@ -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);
-- 
2.20.1





More information about the pve-devel mailing list