Add natnetwork subcommand completion

This commit is contained in:
Shohei YOSHIDA 2022-12-25 10:41:20 +09:00
parent a6f3ed2616
commit 8d40ac67bf
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 40 additions and 1 deletions

View File

@ -309,7 +309,7 @@ _vboxmanage() {
# TODO
;;
(natnetwork)
# TODO
_vboxmanage_natnetwork && ret=0
;;
(hostonlyif)
# TODO
@ -1003,6 +1003,45 @@ _vboxmanage_guestproperty() {
return $ret
}
(( $+functions[_vboxmanage_natnetwork] )) ||
_vboxmanage_natnetwork() {
local ret=1
_arguments -C \
'1: :(add list modify remove start stop)' \
'*:: :->arg' \
&& ret=0
case $state in
(arg)
case $words[1] in
(add|modify)
_arguments \
'(--disable --enable)--disable[Disables the NAT network service]' \
'(--disable --enable)--enable[Enable the NAT network service]' \
'--natname=[Specifies the name of the new internal network interface on the host OS]:name' \
'--network=[Specifies the static or DHCP network address and mask of the NAT service interface]:network' \
'--dhcp=[Enables or disables the DHCP server]: :(on off)' \
'--ipv6=[Enables or disables IPv6]: :(on off)' \
'--loopback-4=[Enables an IPv4 loopback interface by using the specified rule]:rule' \
'--loopback-6=[Enables an IPv6 loopback interface by using the specified rule]:rule' \
'--port-forward-4=[Enables IPv4 port forwarding by using the rule specified by rule]' \
'--port-forward-6=[Enables IPv6 port forwarding by using the rule specified by rule]' \
'*: :_files' \
&& ret=0
;;
(remove|start|stop)
_arguments \
'--natname=[Specifies the name of the NAT]:name' \
&& ret=0
;;
esac
;;
esac
return $ret
}
(( $+functions[_vboxmanage_usbdevsource] )) ||
_vboxmanage_usbdevsource() {
local ret=1