mirror of
https://git.proxmox.com/git/pve-guest-common
synced 2025-07-16 21:32:52 +00:00
Bash completion helper for snapshot name
This is the bash completion helper function for completing the snapshot name. This is used both in qemu-server and pve-container. This patch is the base for the patches in qemu-server and pve-container. Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
This commit is contained in:
parent
1cb9a21d49
commit
eb50bb6141
@ -697,4 +697,17 @@ sub snapshot_rollback {
|
|||||||
$class->lock_config($vmid, $updatefn);
|
$class->lock_config($vmid, $updatefn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# bash completion helper
|
||||||
|
|
||||||
|
sub complete_snapshot_name {
|
||||||
|
my ($class) = @_;
|
||||||
|
my $vmid = $_[4][0];
|
||||||
|
|
||||||
|
my $conf = $class->load_config($vmid);
|
||||||
|
|
||||||
|
my $snapshot = [ keys %{$conf->{snapshots}} ];
|
||||||
|
|
||||||
|
return $snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user