Add hostonlynet subcommand completion

This commit is contained in:
Shohei YOSHIDA 2022-12-25 13:00:17 +09:00
parent 337c43064e
commit 4c66875a7b
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 37 additions and 1 deletions

View File

@ -315,7 +315,7 @@ _vboxmanage() {
_vboxmanage_hostonlyif && ret=0
;;
(hostonlynet)
# TODO
_vboxmanage_hostonlynet && ret=0
;;
(dhcpserver)
# TODO
@ -1318,6 +1318,42 @@ _vboxmanage_hostonlyif() {
return $ret
}
(( $+functions[_vboxmanage_hostonlynet] )) ||
_vboxmanage_hostonlynet() {
local ret=1
_arguments -C \
'1: :(add modify remove)' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(add|modify)
_arguments \
'--name=[The host-only network name]:name' \
'--id=[The host-only network uuid]:netid' \
'--netmask=[The network mask]:netmask' \
'--lower-ip=[The lower IP address range for handing out via DHCP]:lower' \
'--upper-ip=[The upper IP address range for handing out via DHCP]:upper' \
'(--enable --disable)--enable[Enable the host-only network]' \
'(--enable --disable)--disable[Disable the host-only network]' \
&& ret=0
;;
(remove)
_arguments \
'--name=[The host-only network name]:name' \
'--id=[The host-only network uuid]:netid' \
&& ret=0
;;
esac
;;
esac
return $ret
}
(( $+functions[_vboxmanage_usbdevsource] )) ||
_vboxmanage_usbdevsource() {
local ret=1