mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-08 07:49:49 +00:00
print_bash_completion: correctly handle shell quoting
This commit is contained in:
parent
0d8380351a
commit
be3215985f
@ -199,8 +199,7 @@ my $print_bash_completion = sub {
|
|||||||
my $cmdline = substr($ENV{COMP_LINE}, 0, $ENV{COMP_POINT});
|
my $cmdline = substr($ENV{COMP_LINE}, 0, $ENV{COMP_POINT});
|
||||||
print STDERR "\nCMDLINE: $ENV{COMP_LINE}\n" if $debug;
|
print STDERR "\nCMDLINE: $ENV{COMP_LINE}\n" if $debug;
|
||||||
|
|
||||||
# fixme: shell quoting??
|
my @args = PVE::Tools::split_args($cmdline);
|
||||||
my @args = split(/\s+/, $cmdline);
|
|
||||||
my $pos = scalar(@args) - 2;
|
my $pos = scalar(@args) - 2;
|
||||||
$pos += 1 if $cmdline =~ m/\s+$/;
|
$pos += 1 if $cmdline =~ m/\s+$/;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user