add bash completion for content type
This commit is contained in:
@ -34,6 +34,7 @@ __PACKAGE__->register_method ({
|
|||||||
description => "Only list content of this type.",
|
description => "Only list content of this type.",
|
||||||
type => 'string', format => 'pve-storage-content',
|
type => 'string', format => 'pve-storage-content',
|
||||||
optional => 1,
|
optional => 1,
|
||||||
|
completion => \&PVE::Storage::complete_content_type,
|
||||||
},
|
},
|
||||||
vmid => get_standard_option
|
vmid => get_standard_option
|
||||||
('pve-vmid', {
|
('pve-vmid', {
|
||||||
|
|||||||
@ -49,6 +49,7 @@ __PACKAGE__->register_method ({
|
|||||||
description => "Only list stores which support this content type.",
|
description => "Only list stores which support this content type.",
|
||||||
type => 'string', format => 'pve-storage-content-list',
|
type => 'string', format => 'pve-storage-content-list',
|
||||||
optional => 1,
|
optional => 1,
|
||||||
|
completion => \&PVE::Storage::complete_content_type,
|
||||||
},
|
},
|
||||||
enabled => {
|
enabled => {
|
||||||
description => "Only list stores which are enabled (not disabled in config).",
|
description => "Only list stores which are enabled (not disabled in config).",
|
||||||
|
|||||||
@ -1228,4 +1228,10 @@ sub complete_storage_enabled {
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub complete_content_type {
|
||||||
|
my ($cmdname, $pname, $cvalue) = @_;
|
||||||
|
|
||||||
|
return [qw(rootdir images vztmpl iso backup)];
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ my $defaultData = {
|
|||||||
description => "Allowed content types. Note: value 'rootdir' is used for Containers, and value 'images' for KVM-Qemu VM's.\n",
|
description => "Allowed content types. Note: value 'rootdir' is used for Containers, and value 'images' for KVM-Qemu VM's.\n",
|
||||||
type => 'string', format => 'pve-storage-content-list',
|
type => 'string', format => 'pve-storage-content-list',
|
||||||
optional => 1,
|
optional => 1,
|
||||||
|
completion => \&PVE::Storage::complete_content_type,
|
||||||
},
|
},
|
||||||
disable => {
|
disable => {
|
||||||
description => "Flag to disable the storage.",
|
description => "Flag to disable the storage.",
|
||||||
|
|||||||
Reference in New Issue
Block a user