Add usbfilter subcommand completion

This commit is contained in:
Shohei YOSHIDA 2022-12-24 15:50:32 +09:00
parent 2c8261ee2f
commit eff72eacf6
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 41 additions and 1 deletions

View File

@ -291,7 +291,7 @@ _vboxmanage() {
&& ret=0
;;
(usbfilter)
# TODO
_vboxmanage_usbfilter && ret=0
;;
(sharedfolder)
# TODO
@ -881,6 +881,46 @@ _vboxmanage_mediumio_stream() {
'--output=[The output filename]: :_files'
}
(( $+functions[_vboxmanage_usbfilter] )) ||
_vboxmanage_usbfilter() {
local ret=1
_arguments -C \
'1: :(add modify remove)' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(add|modify)
_arguments \
'--action=[Specifies whether to permit VMs access to devices]: :(ignore hold)' \
'--active=[Specifies whether the USB filter is active or temporarily disabled]: :(yes no)' \
'--manufacturer=[Specifies a manufacturer ID filter as a string]:manufacturer' \
'--maskedinterfaces=[Specifies a masked interface filter]:interfaces' \
'--name=[Specifies the name of the filter]:filter' \
'--product=[Specifies a product ID filter as a string]:product' \
'--productid=[Specifies a product ID filter]:product_id' \
'--remote=[Specifies a remote or not]: :(yes no)' \
'--revision=[Specifies a revision ID filter]:revision' \
'--serialnumber=[Specifies a serial number filter as a string]:serial' \
'--target=[Specifies the VM that the filter is attached to]: :_vboxmachines' \
'--vendorid=[Specifies a vendor ID filter]:vendor_id' \
&& ret=0
;;
(remove)
_arguments \
'--target=[Specifies the VM that the filter is attached to]: :_vboxmachines' \
&& ret=0
;;
esac
;;
esac
return $ret
}
(( $+functions[_vboxmanage_guestproperty] )) ||
_vboxmanage_guestproperty() {
local ret=1