From be3215985f97cd0e5e2734af767e50564d3d1a98 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 18 Sep 2015 07:45:32 +0200 Subject: [PATCH] print_bash_completion: correctly handle shell quoting --- src/PVE/CLIHandler.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index c26b0f6..48798ba 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -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+$/; -- 2.39.2