]> git.proxmox.com Git - pve-common.git/commitdiff
CLIHandler: use resolved command definition
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 22 Jan 2018 10:00:07 +0000 (11:00 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 22 Jan 2018 10:07:23 +0000 (11:07 +0100)
For sub commands we resolve the real $cmd, $def and its arguments,
thus we should also get the handler from the resolved $def, not the
global one.

No change for normal (consisting of only the first argument)
commands, for them $cmddef == $def.
This sneaked in in a respin/rebase of the series.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/CLIHandler.pm

index caa7ca640ad37513627584c59d55368500fa6c86..45c0427b2faec2aed843db7c54ba40e665564e85 100644 (file)
@@ -485,7 +485,7 @@ my $handle_cmd  = sub {
 
     &$preparefunc() if $preparefunc;
 
 
     &$preparefunc() if $preparefunc;
 
-    my ($class, $name, $arg_param, $uri_param, $outsub) = @{$cmddef->{$cmd} || []};
+    my ($class, $name, $arg_param, $uri_param, $outsub) = @{$def || []};
     $abort->("unknown command '$cmd_str'") if !$class;
 
     my $prefix = "$exename $cmd_str";
     $abort->("unknown command '$cmd_str'") if !$class;
 
     my $prefix = "$exename $cmd_str";