[pve-devel] [PATCH V2 pve-common 6/6] use better name for string_param_file_mapping (param_mapping).

Dietmar Maurer dietmar at proxmox.com
Fri Mar 2 12:37:23 CET 2018


But keep old one for compatibility.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 src/PVE/CLIHandler.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm
index 5e2d3b8..1fd7b02 100644
--- a/src/PVE/CLIHandler.pm
+++ b/src/PVE/CLIHandler.pm
@@ -118,7 +118,8 @@ sub generate_usage_str {
     $indent //= '';
 
     my $read_password_func = $cli_handler_class->can('read_password');
-    my $param_mapping_func = $cli_handler_class->can('string_param_file_mapping');
+    my $param_mapping_func = $cli_handler_class->can('param_mapping') ||
+	$cli_handler_class->can('string_param_file_mapping');
 
     my ($subcmd, $def) = resolve_cmd($cmd);
 
@@ -546,7 +547,8 @@ sub run_cli_handler {
     my $preparefunc = $params{prepare};
 
     my $read_password_func = $class->can('read_password');
-    my $param_mapping_func = $class->can('string_param_file_mapping');
+    my $param_mapping_func = $cli_handler_class->can('param_mapping') ||
+	$class->can('string_param_file_mapping');
 
     $exename = &$get_exe_name($class);
 
-- 
2.11.0



More information about the pve-devel mailing list