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