]> git.proxmox.com Git - pve-client.git/blobdiff - PVE/APIClient/CLIHandler.pm
update files from pve-common
[pve-client.git] / PVE / APIClient / CLIHandler.pm
index a1cd5281c3d2c59a570f65441761e8bcb6dac50b..a5017f6f8cf934cef0aedcfa93d5f70e70935cc7 100644 (file)
@@ -4,7 +4,6 @@ use strict;
 use warnings;
 
 use PVE::APIClient::SafeSyslog;
-use PVE::APIClient::Exception qw(raise raise_param_exc);
 use PVE::APIClient::RESTHandler;
 
 
@@ -132,7 +131,7 @@ sub generate_usage_str {
        $cli_handler_class->can('string_param_file_mapping');
 
     my ($subcmd, $def, undef, undef, $cmdstr) = resolve_cmd($cmd);
-    die "no such command '$cmd->[0]'\n" if !defined($def) && ref($cmd) eq 'ARRAY';
+    $abort->("unknown command '$cmdstr'") if !defined($def) && ref($cmd) eq 'ARRAY';
 
     my $generate;
     $generate = sub {
@@ -314,7 +313,7 @@ my $print_bash_completion = sub {
     shift @$args; # no need for program name
     my $print_result = sub {
        foreach my $p (@_) {
-           print "$p\n" if $p =~ m/^$cur/;
+           print "$p\n" if $p =~ m/^\Q$cur\E/;
        }
     };