Add list natnets and natnetwork option

This commit is contained in:
Pedro A. Aranda Gutierrez 2022-01-25 19:58:48 +01:00
parent b3469afc24
commit 2c3b218d24
1 changed files with 2 additions and 3 deletions

View File

@ -21,14 +21,12 @@ _vboxmachines() {
done done
} }
# Get natnetworks
_vboxnatnets() { _vboxnatnets() {
vboxmanage list natnetworks | awk -F: '/NetworkName:/{print $2}'| while read natnet; do vboxmanage list natnetworks | awk -F: '/NetworkName:/{print $2}'| while read natnet; do
_wanted 'natnet' expl 'natnet' compadd $natnet _wanted 'natnet' expl 'natnet' compadd $natnet
done done
} }
# Roughly guess command options # Roughly guess command options
_vboxcommandoptions() { _vboxcommandoptions() {
cmd="$1" cmd="$1"
@ -135,6 +133,7 @@ _vboxmanage() {
'hostonlyif:change the IP configuration of a host-only network interface' 'hostonlyif:change the IP configuration of a host-only network interface'
'dhcpserver:control the DHCP server that is built into VirtualBox' 'dhcpserver:control the DHCP server that is built into VirtualBox'
'extpack:add or remove VirtualBox extension packs' 'extpack:add or remove VirtualBox extension packs'
'natnetwork:add,modify,remove or start NatNetworks'
) )
local context state line expl local context state line expl
@ -151,7 +150,7 @@ _vboxmanage() {
list) list)
_arguments \ _arguments \
'--long' \ '--long' \
':list option:(vms runningvms ostypes hostdvds hostfloppies bridgedifs hostonlyifs dhcpservers hostinfo hostcpuids hddbackends hdds dvds floppies usbhost usbfilters systemproperties extpacks)' ':list option:(vms runningvms ostypes hostdvds hostfloppies bridgedifs hostonlyifs dhcpservers hostinfo hostcpuids hddbackends hdds dvds floppies usbhost usbfilters systemproperties natnetworks extpacks)'
;; ;;
showvminfo) showvminfo)
_arguments \ _arguments \