use better name for string_param_file_mapping (param_mapping).
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 2 Mar 2018 11:37:23 +0000 (12:37 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 6 Mar 2018 07:47:00 +0000 (08:47 +0100)
But keep old one for compatibility.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
src/PVE/CLIHandler.pm

index 5e2d3b8..1fd7b02 100644 (file)
@@ -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);