X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FCLIHandler.pm;h=9a2f8418e21cd51d748e2fa08451181575af4c2b;hp=c2d34387ac87c4a9331d229f6064cbe1e5625498;hb=408976c6f711f82895b105733b914660384160df;hpb=b9df2e606393a6276f0350706f2099d0e7bc2038 diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index c2d3438..9a2f841 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -452,7 +452,7 @@ sub generate_asciidoc_synopsys { } my $handle_cmd = sub { - my ($def, $cmdname, $cmd, $args, $pwcallback, $podfn, $preparefunc) = @_; + my ($def, $cmdname, $cmd, $args, $pwcallback, $podfn, $preparefunc, $stringfilemap) = @_; $cmddef = $def; $exename = $cmdname; @@ -486,13 +486,13 @@ my $handle_cmd = sub { } my $prefix = "$exename $cmd"; - my $res = $class->cli_handler($prefix, $name, \@ARGV, $arg_param, $uri_param, $pwcallback); + my $res = $class->cli_handler($prefix, $name, \@ARGV, $arg_param, $uri_param, $pwcallback, $stringfilemap); &$outsub($res) if $outsub; }; my $handle_simple_cmd = sub { - my ($def, $args, $pwcallback, $podfn, $preparefunc) = @_; + my ($def, $args, $pwcallback, $podfn, $preparefunc, $stringfilemap) = @_; my ($class, $name, $arg_param, $uri_param, $outsub) = @{$def}; die "no class specified" if !$class; @@ -519,7 +519,7 @@ my $handle_simple_cmd = sub { &$preparefunc() if $preparefunc; - my $res = $class->cli_handler($name, $name, \@ARGV, $arg_param, $uri_param, $pwcallback); + my $res = $class->cli_handler($name, $name, \@ARGV, $arg_param, $uri_param, $pwcallback, $stringfilemap); &$outsub($res) if $outsub; }; @@ -553,6 +553,7 @@ sub run_cli_handler { my $no_init = $params{no_init}; my $pwcallback = $class->can('read_password'); + my $stringfilemap = $class->can('string_param_file_mapping'); $exename = &$get_exe_name($class); @@ -573,11 +574,11 @@ sub run_cli_handler { my $def = ${"${class}::cmddef"}; if (ref($def) eq 'ARRAY') { - &$handle_simple_cmd($def, \@ARGV, $pwcallback, $podfn, $preparefunc); + &$handle_simple_cmd($def, \@ARGV, $pwcallback, $podfn, $preparefunc, $stringfilemap); } else { $cmddef = $def; my $cmd = shift @ARGV; - &$handle_cmd($cmddef, $exename, $cmd, \@ARGV, $pwcallback, $podfn, $preparefunc); + &$handle_cmd($cmddef, $exename, $cmd, \@ARGV, $pwcallback, $podfn, $preparefunc, $stringfilemap); } exit 0;