X-Git-Url: https://git.proxmox.com/?p=pve-client.git;a=blobdiff_plain;f=pveclient;h=d8d4d15da682bc772558e0099d75761dd46b6d12;hp=d24ec49f63e79039fee51efa1c4f3d7a0718e9cb;hb=dce6ecbc505f8ea6f1231f5fd1fd9140636d7c2e;hpb=adf285bf0d623d059890dc1b957db42b3ebed826 diff --git a/pveclient b/pveclient index d24ec49..d8d4d15 100755 --- a/pveclient +++ b/pveclient @@ -80,6 +80,21 @@ if ($cmd eq 'get') { PVE::APIClient::Commands::lxc->run_cli_handler(); } elsif ($cmd eq 'remote') { PVE::APIClient::Commands::remote->run_cli_handler(); +} elsif ($cmd eq 'bashcomplete') { + + my $cmdline = substr($ENV{COMP_LINE}, 0, $ENV{COMP_POINT}); + $cmdline =~ s/$cur$//; + + my ($bash_command, $cur, $prev) = @ARGV; + + my $args = [split(/\s+/, $cmdline)]; + + if (scalar(@$args) == 1) { + foreach my $p (qw(get set create delete lxc remote)) { + print "$p\n" if $p =~ m/^$cur/; + } + } + } else { print_usage(); }