Add hostonlyif subcommand completion

This commit is contained in:
Shohei YOSHIDA 2022-12-25 12:56:22 +09:00
parent 46e5e95405
commit 337c43064e
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 29 additions and 1 deletions

View File

@ -312,7 +312,7 @@ _vboxmanage() {
_vboxmanage_natnetwork && ret=0 _vboxmanage_natnetwork && ret=0
;; ;;
(hostonlyif) (hostonlyif)
# TODO _vboxmanage_hostonlyif && ret=0
;; ;;
(hostonlynet) (hostonlynet)
# TODO # TODO
@ -1290,6 +1290,34 @@ _vboxmanage_natnetwork() {
return $ret return $ret
} }
(( $+functions[_vboxmanage_hostonlyif] )) ||
_vboxmanage_hostonlyif() {
local ret=1
_arguments -C \
'1: :(ipconfig create remove)' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(ipconfig)
_arguments \
'--dhcp[Uses DHCP for the network interface]' \
'--ip=[Specifies the IPv4 IP address for the network interface]:ipv4' \
'--netmask=[Specifies the IPv4 netmask of the network interface]:v4mask' \
'--ipv6=[Specifies the IPv6 IP address for the network interface]:ipv6' \
'--netmasklengthv6=[Specifies the length of the IPv6 network interface]:length' \
&& ret=0
;;
esac
;;
esac
return $ret
}
(( $+functions[_vboxmanage_usbdevsource] )) || (( $+functions[_vboxmanage_usbdevsource] )) ||
_vboxmanage_usbdevsource() { _vboxmanage_usbdevsource() {
local ret=1 local ret=1