10 Commits

Author SHA1 Message Date
d60719b8e2 Updated unattended command 2023-03-13 18:23:46 +01:00
a839731fe6 Updated debugvm command 2023-03-13 18:14:27 +01:00
4557521b27 Updated dhcpserver command 2023-03-13 17:56:56 +01:00
507b4aa0bd Updated mediumio command 2023-03-13 17:31:02 +01:00
8d90209fcc Updated export command 2023-03-13 17:26:48 +01:00
c212439a64 Updated import command 2023-03-13 17:10:43 +01:00
12e85b78da Updated controlvm command 2023-03-13 15:54:56 +01:00
385c78df30 Updated startvm command 2023-03-13 14:41:13 +01:00
ce1c0c1b19 Added encryptvm command 2023-03-13 13:25:15 +01:00
7c42bcd22f Updated clonevm command 2023-03-13 12:45:34 +01:00

View File

@@ -601,8 +601,8 @@ _VBoxManage() {
_vms_comp vms _vms_comp vms
else else
_find_item_name 2 _find_item_name 2
items=(--snapshot --mode --options --name --groups --basefolder items=( --basefolder --groups --mode --name --options --register
--uuid --register --snapshot) --snapshot --uuid )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in case "${prev}" in
@@ -615,8 +615,8 @@ _VBoxManage() {
all" -- ${cur}) ) all" -- ${cur}) )
;; ;;
--options) --options)
COMPREPLY=( $(compgen -W "link keepallmacs keepnatmacs COMPREPLY=( $(compgen -W "Link KeepAllMACs KeepNATMACs
keepdisknames keephwuuids" -- ${cur}) ) KeepDiskNames KeepHwUUIDs" -- ${cur}) )
;; ;;
--groups) --groups)
COMPREPLY=() COMPREPLY=()
@@ -816,30 +816,34 @@ _VBoxManage() {
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp runningvms _vms_comp runningvms
else else
local items=(acpipowerbutton acpisleepbutton clipboard local items=( acpipowerbutton acpisleepbutton addencpassword
cpuexecutioncap draganddrop guestmemoryballoon audioin audioout autostart-delayseconds autostart-enabled1
keyboardputscancode natpf1 nic1 nicpromisc1 nicproperty1 autostart-enabled2 autostart-enabled3 autostart-enabled4
nictrace1 nictracefile1 natpf2 nic2 nicpromisc2 nicproperty2 changeuartmode1 changeuartmode2 clipboard cpuexecutioncap
nictrace2 nictracefile2 natpf3 nic3 nicpromisc3 nicproperty3 draganddrop guestmemoryballoon keyboardputfile
nictrace3 nictracefile3 natpf4 nic4 nicpromisc4 nicproperty4 keyboardputscancode keyboardputstring natpf1 natpf2 natpf3
nictrace4 nictracefile4 natpf5 nic5 nicpromisc5 nicproperty5 natpf4 natpf5 natpf6 natpf7 natpf8 natpf9 natpf1delete
nictrace5 nictracefile5 natpf6 nic6 nicpromisc6 nicproperty6 natpf2delete natpf3delete natpf4delete natpf5delete natpf6delete
nictrace6 nictracefile6 natpf7 nic7 nicpromisc7 nicproperty7 natpf7delete natpf8delete nic1 nic2 nic3 nic4 nic5 nic6 nic7
nictrace7 nictracefile7 natpf8 nic8 nicpromisc8 nicproperty8 nic8 nicpromisc1 nicpromisc2 nicpromisc3 nicpromisc4 nicpromisc5
nictrace8 pause plugcpu poweroff reset resume savestate nicpromisc6 nicpromisc7 nicpromisc8 nicproperty1 nicproperty2
screenshotpng setcredentials setlinkstate1 setlinkstate2 nicproperty3 nicproperty4 nicproperty5 nicproperty6 nicproperty7
setlinkstate3 setlinkstate4 setlinkstate5 setlinkstate6 nicproperty8 nictrace1 nictrace2 nictrace3 nictrace4 nictrace5
setlinkstate7 setlinkstate8 setvideomodehint teleport unplugcpu nictrace6 nictrace7 nictrace8 nictracefile1 nictracefile2
usbattach usbdetach vrde vrdeport vrdeproperty nictracefile3 nictracefile4 nictracefile5 nictracefile6
vrdevideochannelquality webcam recording addencpassword nictracefile7 nictracefile8 pause plugcpu poweroff reboot
removeencpassword removeallencpasswords keyboardputstring recording removeallencpasswords removeencpassword reset resume
keyboardputfile audioin audioout setscreenlayout changeuartmode1 savestate screenshotpng setcredentials setlinkstate1
changeuartmode2 vm-process-priority) setlinkstate2 setlinkstate3 setlinkstate4 setlinkstate5
setlinkstate6 setlinkstate7 setlinkstate8 setscreenlayout
setvideomodehint shutdown teleport unplugcpu usbattach usbdetach
vm-process-priority vrde vrdeport vrdeproperty
vrdevideochannelquality webcam )
_find_item_name 2 _find_item_name 2
subcommand=${COMP_WORDS[$((index+1))]} subcommand=${COMP_WORDS[$((index+1))]}
if [[ " ${items[@]} " == *" $subcommand "* ]]; then if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
keyboardputfile|nictracefile[1-8]) keyboardputfile|nictracefile[1-8])
[[ ${prev} == "nictracefile"* ]] && \ [[ ${prev} == "nictracefile"* ]] && \
@@ -864,14 +868,10 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "delete tcp COMPREPLY=( $(compgen -W "delete tcp
udp" -- ${cur}) ) udp" -- ${cur}) )
;; ;;
audioin|audioout|setlinkstate[1-8])
[[ ${prev} == "setlinkstate"* ]] && \
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;;
clipboard) clipboard)
[[ ${prev} == "clipboard" ]] && \ [[ ${prev} == "clipboard" ]] && \
COMPREPLY=( $(compgen -W "disabled hosttoguest COMPREPLY=( $(compgen -W "mode filetransfers" \
guesttohost bidirectional" -- ${cur}) ) -- ${cur}) )
;; ;;
draganddrop) draganddrop)
[[ ${prev} == "draganddrop" ]] && \ [[ ${prev} == "draganddrop" ]] && \
@@ -884,13 +884,13 @@ _VBoxManage() {
;; ;;
recording) recording)
[[ ${prev} == "recording" ]] && \ [[ ${prev} == "recording" ]] && \
COMPREPLY=( $(compgen -W "on off screens COMPREPLY=( $(compgen -W "filename maxfilesize
filename videores videorate videofps maxtime maxtime off on screens videofps videorate
maxfilesize" -- ${cur}) ) videores" -- ${cur}) )
case "${prev}" in case "${prev}" in
screens) screens)
COMPREPLY=( $(compgen -W "all none COMPREPLY=( $(compgen -W "all none
<screen>" -- ${cur}) ) <screen-ID>" -- ${cur}) )
;; ;;
filename) filename)
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
@@ -930,26 +930,54 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "yes no" -- ${cur}) ) COMPREPLY=( $(compgen -W "yes no" -- ${cur}) )
;; ;;
addencpassword) addencpassword)
tmp=(--host --port --maxdowntime --passwordfile tmp=( --removeonsuspend )
--password)
_get_excluded_items "${tmp[@]}" _get_excluded_items "${tmp[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
changeuartmode[1-2]) changeuartmode[1-2])
tmp=(disconnected server client tcpserver tcpclient tmp=(disconnected serverpipe-name clientpipe-name
file "<devicename>") tcpserverport tcpclienthostname:port filefilename
device-name)
_get_excluded_items "${tmp[@]}" _get_excluded_items "${tmp[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
vm-process-priority) vm-process-priority)
COMPREPLY=( $(compgen -W "default flat low normal COMPREPLY=( $(compgen -W "default flat low normal
high" -- ${cur}) ) high" -- ${cur}) )
;; ;;
setscreenlayout)
if [[ "${prev}" != "${subcommand}" ]]; then
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
fi
;;
shutdown)
COMPREPLY=( $(compgen -W "--force" -- ${cur}) )
;;
esac esac
elif [[ ${prev} == "--passwordfile" || ${prev} == "--capturefile" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else else
case "${prev}" in
--passwordfile|--capturefile|screenshotpng|\
keyboardputfile|nictracefile[1-8])
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
audioin|audioout|autostart-enabled[1-4]|filetransfers|\
nictrace[1-8]|setlinkstate[1-8]|vrde)
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;;
--allowlocallogon)
COMPREPLY=( $(compgen -W "yes no" -- ${cur}) )
;;
mode)
COMPREPLY=( $(compgen -W "disabled hosttoguest
guesttohost bidirectional" -- ${cur}) )
;;
esac
[[ ${#COMPREPLY[@]} -eq 0 ]] && \ [[ ${#COMPREPLY[@]} -eq 0 ]] && \
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
fi fi
@@ -1043,16 +1071,17 @@ _VBoxManage() {
;; ;;
"debugvm") "debugvm")
items=(dumpguestcore info injectnmi log logdest logflags osdetect items=(dumpvmcore info injectnmi log logdest logflags osdetect
osinfo osdmesg getregisters setregisters show statistics stack) osinfo osdmesg getregisters setregisters show stack statistics
guestsample)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp runningvms _vms_comp runningvms
else else
_find_item_name 2 _find_item_name 2
subcommand=${COMP_WORDS[$((index+1))]} subcommand=${COMP_WORDS[$((index+1))]}
if [[ " ${items[@]} " == *" $subcommand "* ]]; then if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
dumpguestcore) dumpvmcore)
_get_excluded_items "--filename" _get_excluded_items "--filename"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
@@ -1077,10 +1106,13 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
osdmesg) osdmesg)
items=() items=(--lines)
[[ " ${COMP_WORDS[@]} " != *" --lines "* && _get_excluded_items "${items[@]}"
" ${COMP_WORDS[@]} " != *" -n "* ]] && COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
items+=(--lines -n) ;;
guestsample)
items=(--filename --sample-interval-us
--sample-time-us)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
@@ -1096,35 +1128,35 @@ _VBoxManage() {
;; ;;
dhcpserver) dhcpserver)
items=(add modify remove restart findlease) items=(add modify remove restart stop findlease)
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
if [[ " ${items[@]} " == *" $subcommand "* ]]; then if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
add) add)
items=(--server-ip --netmask --lower-ip --upper-ip) items=(--server-ip --netmask --lower-ip --upper-ip)
[[ " ${COMP_WORDS[@]} " != *" --interface"* && [[ " ${COMP_WORDS[*]} " != *" --interface"* &&
" ${COMP_WORDS[@]} " != *" --network"* ]] && " ${COMP_WORDS[*]} " != *" --network"* ]] &&
items+=(--network --interface) items+=(--network --interface)
[[ " ${COMP_WORDS[@]} " != *" --enable"* && [[ " ${COMP_WORDS[*]} " != *" --enable"* &&
" ${COMP_WORDS[@]} " != *" --disable"* ]] && " ${COMP_WORDS[*]} " != *" --disable"* ]] &&
items+=(--enable --disable) items+=(--enable --disable)
[[ " ${COMP_WORDS[@]} " == *" --options"* ]] && [[ " ${COMP_WORDS[*]} " == *" --options"* ]] &&
items+=(--vm --nic --id --value --remove) items+=(--vm --nic --id --value --remove)
[[ " ${COMP_WORDS[@]} " != *" --global"* && [[ " ${COMP_WORDS[*]} " != *" --global"* &&
" ${COMP_WORDS[@]} " != *" --group"* && " ${COMP_WORDS[*]} " != *" --group"* &&
" ${COMP_WORDS[@]} " != *" --vm"* && " ${COMP_WORDS[*]} " != *" --vm"* &&
" ${COMP_WORDS[@]} " != *" --mac-address"* ]] && " ${COMP_WORDS[*]} " != *" --mac-address"* ]] &&
items+=(--global --group --vm --mac-address) items+=(--global --group --vm --mac-address)
[[ " ${COMP_WORDS[@]} " == *" --global"* ]] && [[ " ${COMP_WORDS[*]} " == *" --global"* ]] &&
items+=(--set-opt --set-opt-hex --force-opt items+=(--set-opt --set-opt-hex --force-opt
--supress-opt --min-lease-time --default-lease-time --supress-opt --min-lease-time --default-lease-time
--max-lease-time) --max-lease-time)
[[ " ${COMP_WORDS[@]} " == *" --group"* ]] && [[ " ${COMP_WORDS[*]} " == *" --group"* ]] &&
items+=(--set-opt --set-opt-hex --force-opt items+=(--set-opt --set-opt-hex --force-opt
--supress-opt --incl-mac --excl-mac --incl-mac-wild --supress-opt --incl-mac --excl-mac --incl-mac-wild
--excl-mac-wild --incl-vendor --excl-vendor --excl-mac-wild --incl-vendor --excl-vendor
@@ -1133,12 +1165,12 @@ _VBoxManage() {
--min-lease-time --default-lease-time --min-lease-time --default-lease-time
--max-lease-time) --max-lease-time)
[[ " ${COMP_WORDS[@]} " == *" --vm"* ]] && [[ " ${COMP_WORDS[*]} " == *" --vm"* ]] &&
items+=(--nic --set-opt --set-opt-hex --force-opt items+=(--nic --set-opt --set-opt-hex --force-opt
--supress-opt --min-lease-time --default-lease-time --supress-opt --min-lease-time --default-lease-time
--max-lease-time --fixed-address) --max-lease-time --fixed-address)
[[ " ${COMP_WORDS[@]} " == *" --mac-address"* ]] && [[ " ${COMP_WORDS[*]} " == *" --mac-address"* ]] &&
items+=(--set-opt --set-opt-hex --force-opt items+=(--set-opt --set-opt-hex --force-opt
--supress-opt --min-lease-time --default-lease-time --supress-opt --min-lease-time --default-lease-time
--max-lease-time --fixed-address) --max-lease-time --fixed-address)
@@ -1148,30 +1180,30 @@ _VBoxManage() {
;; ;;
modify) modify)
items=(--server-ip --netmask --lower-ip --upper-ip) items=(--server-ip --netmask --lower-ip --upper-ip)
[[ " ${COMP_WORDS[@]} " != *" --interface"* && [[ " ${COMP_WORDS[*]} " != *" --interface"* &&
" ${COMP_WORDS[@]} " != *" --network"* ]] && " ${COMP_WORDS[*]} " != *" --network"* ]] &&
items+=(--network --interface) items+=(--network --interface)
[[ " ${COMP_WORDS[@]} " != *" --enable"* && [[ " ${COMP_WORDS[*]} " != *" --enable"* &&
" ${COMP_WORDS[@]} " != *" --disable"* ]] && " ${COMP_WORDS[*]} " != *" --disable"* ]] &&
items+=(--enable --disable) items+=(--enable --disable)
[[ " ${COMP_WORDS[@]} " == *" --options"* ]] && [[ " ${COMP_WORDS[*]} " == *" --options"* ]] &&
items+=(--vm --nic --id --value --remove) items+=(--vm --nic --id --value --remove)
[[ " ${COMP_WORDS[@]} " != *" --global"* && [[ " ${COMP_WORDS[*]} " != *" --global"* &&
" ${COMP_WORDS[@]} " != *" --group"* && " ${COMP_WORDS[*]} " != *" --group"* &&
" ${COMP_WORDS[@]} " != *" --vm"* && " ${COMP_WORDS[*]} " != *" --vm"* &&
" ${COMP_WORDS[@]} " != *" --mac-address"* ]] && " ${COMP_WORDS[*]} " != *" --mac-address"* ]] &&
items+=(--global --group --vm --mac-address) items+=(--global --group --vm --mac-address)
[[ " ${COMP_WORDS[@]} " == *" --global"* ]] && [[ " ${COMP_WORDS[*]} " == *" --global"* ]] &&
items+=(--del-opt --set-opt --set-opt-hex --force-opt items+=(--del-opt --set-opt --set-opt-hex --force-opt
--unforce-opt --supress-opt --unsupress-opt --unforce-opt --supress-opt --unsupress-opt
--min-lease-time --default-lease-time --min-lease-time --default-lease-time
--max-lease-time --remove-config) --max-lease-time --remove-config)
[[ " ${COMP_WORDS[@]} " == *" --group"* ]] && [[ " ${COMP_WORDS[*]} " == *" --group"* ]] &&
items+=(--set-opt-hex --force-opt --unforce-opt items+=(--set-opt-hex --force-opt --unforce-opt
--supress-opt --unsupress-opt --del-mac --incl-mac --supress-opt --unsupress-opt --del-mac --incl-mac
--excl-mac --del-mac-wild --incl-mac-wild --excl-mac --del-mac-wild --incl-mac-wild
@@ -1183,13 +1215,13 @@ _VBoxManage() {
--default-lease-time --max-lease-time --default-lease-time --max-lease-time
--remove-config) --remove-config)
[[ " ${COMP_WORDS[@]} " == *" --vm"* ]] && [[ " ${COMP_WORDS[*]} " == *" --vm"* ]] &&
items+=(--del-opt --set-opt --set-opt-hex --force-opt items+=(--del-opt --set-opt --set-opt-hex --force-opt
--unforce-opt --supress-opt --unsupress-opt --unforce-opt --supress-opt --unsupress-opt
--min-lease-time --default-lease-time --min-lease-time --default-lease-time
--max-lease-time --fixed-address --remove-config) --max-lease-time --fixed-address --remove-config)
[[ " ${COMP_WORDS[@]} " == *" --mac-address"* ]] && [[ " ${COMP_WORDS[*]} " == *" --mac-address"* ]] &&
items+=(--set-opt --set-opt-hex --force-opt items+=(--set-opt --set-opt-hex --force-opt
--unforce-opt --supress-opt --unsupress-opt --unforce-opt --supress-opt --unsupress-opt
--min-lease-time --default-lease-time --min-lease-time --default-lease-time
@@ -1198,7 +1230,7 @@ _VBoxManage() {
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
remove|restart) remove|restart|stop)
case "${prev}" in case "${prev}" in
--network) --network)
COMPREPLY=() COMPREPLY=()
@@ -1210,8 +1242,8 @@ _VBoxManage() {
;; ;;
esac esac
if [[ " ${COMP_WORDS[@]} " != *" --interface"* && if [[ " ${COMP_WORDS[*]} " != *" --interface"* &&
" ${COMP_WORDS[@]} " != *" --network"* ]]; then " ${COMP_WORDS[*]} " != *" --network"* ]]; then
items=(--network --interface) items=(--network --interface)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -1230,8 +1262,8 @@ _VBoxManage() {
;; ;;
esac esac
if [[ " ${COMP_WORDS[@]} " != *" --interface"* && if [[ " ${COMP_WORDS[*]} " != *" --interface"* &&
" ${COMP_WORDS[@]} " != *" --network"* ]]; then " ${COMP_WORDS[*]} " != *" --network"* ]]; then
items+=(--network --interface) items+=(--network --interface)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -1262,8 +1294,50 @@ _VBoxManage() {
fi fi
;; ;;
encryptvm)
items=( addpassword checkpassword removepassword setencryption )
if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms
else
_find_item_name 2
subcommand=${COMP_WORDS[$((index+1))]}
if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in
addpassword)
items=( --passwordfile --password-id )
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;;
checkpassword)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
removepassword)
COMPREPLY=()
;;
setencryption)
items=( --old-passwordfile --ciphercipher-identifier
--new-passwordfile --new-password-id --force )
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;;
esac
else
case "$prev" in
--new-passwordfile|--old-passwordfile|--passwordfile)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
*)
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
COMPREPLY=( $(compgen -W "${items[*]}" \
-- ${cur}) )
esac
fi
fi
;;
"export") "export")
items=( --manifest --options --vsys --cloud --cloudinitscriptpath ) items=( --manifest --options --vsys --cloud --cloudinitscriptpath
--output)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
elif [[ ${prev} == "--eulafile" ]]; then elif [[ ${prev} == "--eulafile" ]]; then
@@ -1273,19 +1347,16 @@ _VBoxManage() {
${prev} == "--cloudpublicip" ]]; then ${prev} == "--cloudpublicip" ]]; then
COMPREPLY=( $(compgen -W "true false" -- ${cur}) ) COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
else else
[[ " ${COMP_WORDS[@]} " != *" -o "* && [[ " ${COMP_WORDS[*]} " != *" --legacy09 "* &&
" ${COMP_WORDS[@]} " != *" --output "* ]] && " ${COMP_WORDS[*]} " != *" --ovf09 "* &&
items+=(-o --output) " ${COMP_WORDS[*]} " != *" --ovf10 "* &&
[[ " ${COMP_WORDS[@]} " != *" --legacy09 "* && " ${COMP_WORDS[*]} " != *" --ovf20 "* &&
" ${COMP_WORDS[@]} " != *" --ovf09 "* && " ${COMP_WORDS[*]} " != *" --opc10 "* ]] &&
" ${COMP_WORDS[@]} " != *" --ovf10 "* &&
" ${COMP_WORDS[@]} " != *" --ovf20 "* &&
" ${COMP_WORDS[@]} " != *" --opc20 "* ]] &&
items+=(--legacy09 --ovf09 --ovf10 --ovf20 --opc10) items+=(--legacy09 --ovf09 --ovf10 --ovf20 --opc10)
[[ " ${COMP_WORDS[@]} " == *" --vsys "* ]] && [[ " ${COMP_WORDS[*]} " == *" --vsys "* ]] &&
items+=(--product --producturl --vendor --vendorurl items+=(--product --producturl --vendor --vendorurl
--version --description --eula --eulafile --vmname) --version --description --eula --eulafile --vmname)
[[ " ${COMP_WORDS[@]} " == *" --cloud"* ]] && [[ " ${COMP_WORDS[*]} " == *" --cloud"* ]] &&
items+=(--vmname --cloudprofile --cloudshape --clouddomain items+=(--vmname --cloudprofile --cloudshape --clouddomain
--clouddisksize --cloudbucket --cloudocivcn --cloudocisubnet --clouddisksize --cloudbucket --cloudocivcn --cloudocisubnet
--cloudkeepobject --cloudlaunchinstance --cloudpublicip --cloudkeepobject --cloudlaunchinstance --cloudpublicip
@@ -1302,6 +1373,9 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "EMULATED PARAVIRTUALIZED" \ COMPREPLY=( $(compgen -W "EMULATED PARAVIRTUALIZED" \
-- ${cur}) ) -- ${cur}) )
;; ;;
--cloudkeepobject|--cloudlaunchinstance|--cloudpublicip)
COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
esac esac
[[ ${#COMPREPLY[@]} -eq 0 ]] && \ [[ ${#COMPREPLY[@]} -eq 0 ]] && \
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
@@ -1311,7 +1385,7 @@ _VBoxManage() {
extpack) extpack)
items=(install uninstall cleanup) items=(install uninstall cleanup)
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
if [[ " ${items[@]} " == *" $subcommand "* ]]; then if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
install) install)
_get_excluded_items "--replace --accept-license" _get_excluded_items "--replace --accept-license"
@@ -1729,8 +1803,11 @@ _VBoxManage() {
;; ;;
import) import)
items=(--options --dry-run -n --vmname --cloud --cloudprofile items=(--basefolder --cloud --cloudbucket --cloudinstanceid
--cloudinstanceid --cloudbucket) --cloudprofile --controller --cpus --description --disk
--dry-run --eula --group --ignore --memory --options --ostype
--port --scsitype --settingsfile --unit --vmname --vsys)
if [[ "${prev}" == "import" ]]; then if [[ "${prev}" == "import" ]]; then
COMPREPLY=( $(compgen -o plusdirs -f -X '!@(*.ovf|*.ova)' \ COMPREPLY=( $(compgen -o plusdirs -f -X '!@(*.ovf|*.ova)' \
-- ${cur}) ) -- ${cur}) )
@@ -1740,10 +1817,20 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "keepallmacs keepnatmacs COMPREPLY=( $(compgen -W "keepallmacs keepnatmacs
importtovdi" -- ${cur}) ) importtovdi" -- ${cur}) )
;; ;;
--basefolder)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;;
--eula)=
COMPREPLY=( $(compgen -W "show accept" -- ${cur}) )
;;
--settingsfile)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
--scsitype)
COMPREPLY=( $(compgen -W "BusLogic LsiLogic" -- ${cur}) )
;;
esac esac
[[ " ${COMP_WORDS[@]} " != *" --dry-run"* &&
" ${COMP_WORDS[@]} " != *" -n"* ]] &&
items+=(-n --dry-run)
if [[ ${#COMPREPLY[@]} -eq 0 ]]; then if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
@@ -1785,12 +1872,16 @@ _VBoxManage() {
--output" -- ${cur}) ) --output" -- ${cur}) )
;; ;;
stream) stream)
COMPREPLY=( $(compgen -W "--forma --variant COMPREPLY=( $(compgen -W "--format --variant
--output" -- ${cur}) ) --output" -- ${cur}) )
;; ;;
--password-file)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
*) *)
COMPREPLY=( $(compgen -W "--password-file cat formatfat COMPREPLY=( $(compgen -W "--password-file cat formatfat
stream" -- ${cur}) ) stream" -- ${cur}) )
;;
esac esac
fi fi
;; ;;
@@ -2526,14 +2617,10 @@ _VBoxManage() {
_vms_comp vms 1 _vms_comp vms 1
elif [[ "${prev}" == "--type" ]]; then elif [[ "${prev}" == "--type" ]]; then
COMPREPLY=( $(compgen -W "gui sdl headless separate" -- ${cur}) ) COMPREPLY=( $(compgen -W "gui sdl headless separate" -- ${cur}) )
elif [[ "${prev}" == "--passwordfile" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else else
local items=(--putenv -E) items=( --type --putenv --passwordfile --password-id )
_is_any_item_used "${items[@]}"
if [[ "${result}" == "ITIS" ]]; then
local items=(--type)
else
local items=(--type -E --putenv)
fi
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi fi
@@ -2716,19 +2803,17 @@ _VBoxManage() {
if [[ ${prev} == ${subcommand} ]]; then if [[ ${prev} == ${subcommand} ]]; then
_vms_comp vms _vms_comp vms
else else
local items=(--iso --user=login local items=(--additions-iso
--password=password --password-file --auxiliary-base-path --country --dry-run
--full-user-name --key --extra-install-kernel-parameters
--install-additions --no-install-additions --full-user-name --hostname --image-index
--additions-iso --install-txs --no-install-txs --install-additions --install-txs --iso --key
--validation-kit-iso --locale --country --language --locale --no-install-additions
--time-zone --hostname --no-install-txs --package-selection-adjustment
--package-selection-adjustment --dry-run --password --password-file
--auxiliary-base-path=path --image-index --post-install-command --post-install-template
--script-template --post-install-template --script-template --start-vm --time-zone --user
--post-install-command --validation-kit-iso)
--extra-install-kernel-parameters --language
--start-vm)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi fi