]> git.proxmox.com Git - pve-common.git/commitdiff
print_bash_completion: correctly handle shell quoting
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 18 Sep 2015 05:45:32 +0000 (07:45 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 18 Sep 2015 05:45:32 +0000 (07:45 +0200)
src/PVE/CLIHandler.pm

index c26b0f6364d85a043336a30285fdd8061ff39f84..48798ba9a804c6f7b7a729d5ffddf27752ea2ea7 100644 (file)
@@ -199,8 +199,7 @@ my $print_bash_completion = sub {
     my $cmdline = substr($ENV{COMP_LINE}, 0, $ENV{COMP_POINT});
     print STDERR "\nCMDLINE: $ENV{COMP_LINE}\n" if $debug;
 
-    # fixme: shell quoting??
-    my @args = split(/\s+/, $cmdline);
+    my @args = PVE::Tools::split_args($cmdline);
     my $pos = scalar(@args) - 2;
     $pos += 1 if $cmdline =~ m/\s+$/;