14 Commits

Author SHA1 Message Date
ab6d9f7cd9 Added missing completions for cloud related commands.
Also, removed trailing spaces.
2023-11-02 18:11:41 +01:00
3bb795a1e3 Bump to 7.0.10 2023-09-11 10:30:29 +02:00
468a0a4c32 Bump to 7.0.8 2023-06-23 18:26:15 +02:00
59ffe61fd6 Bump to 7.0.6 2023-03-20 12:43:40 +01:00
7c13b0ab6b Bump to version 7.0.4 2023-03-20 12:36:51 +01:00
67ac4d655f Updated natnetwork command 2023-03-20 11:33:21 +01:00
8dd76f3295 Fix typos with COMP_CWORD varialble 2023-03-19 18:55:25 +01:00
8fd579c2cd Updated convertfromraw command 2023-03-19 18:41:01 +01:00
51a393f8fe Updated mediumproperty command 2023-03-19 17:17:20 +01:00
f23ce2aedb Update clonemedium command 2023-03-19 17:13:36 +01:00
350e0aedaf Update createmedium command 2023-03-19 16:40:01 +01:00
25d7fb4048 Update bandwithctl command 2023-03-19 16:36:37 +01:00
0077621f1b Update storagectl command 2023-03-19 16:34:40 +01:00
52aa7111fa Update storageattach command 2023-03-19 16:27:42 +01:00
2 changed files with 216 additions and 320 deletions

View File

@@ -6,7 +6,7 @@ script. However, in some point of time I've decided to rewrite it almost from
scratch. scratch.
Current version of script was written and tested against VBoxManage in version Current version of script was written and tested against VBoxManage in version
6.1.38, and should contain all commands and their options. 7.0.10, and should contain all commands and their options.
Unlike other attempts, I've tried to make the script context aware. See the Unlike other attempts, I've tried to make the script context aware. See the
simple session with the VBoxManage command below, to have an idea how it works: simple session with the VBoxManage command below, to have an idea how it works:

View File

@@ -4,7 +4,7 @@
# URL: https://bitbucket.org/gryf/vboxmanage-bash-completion # URL: https://bitbucket.org/gryf/vboxmanage-bash-completion
# URL: https://github.com/gryf/vboxmanage-bash-completion # URL: https://github.com/gryf/vboxmanage-bash-completion
# License: 3-clause BSD-style license (see LICENSE file) # License: 3-clause BSD-style license (see LICENSE file)
# Version: 6.1.38 # Version: 7.0.10
_VBoxManage() { _VBoxManage() {
@@ -41,7 +41,7 @@ _VBoxManage() {
result="" result=""
for i in $@; do for i in $@; do
[[ " ${COMP_WORDS[@]} " == *" $i "* ]] && continue [[ " ${COMP_WORDS[*]} " == *" $i "* ]] && continue
result="$result $i" result="$result $i"
done done
} }
@@ -51,7 +51,7 @@ _VBoxManage() {
result="" result=""
for i in $@; do for i in $@; do
if [[ " ${COMP_WORDS[@]} " == *" $i "* ]]; then if [[ " ${COMP_WORDS[*]} " == *" $i "* ]]; then
result="ITIS" result="ITIS"
break break
fi fi
@@ -423,7 +423,7 @@ _VBoxManage() {
# foo bar disk baz # foo bar disk baz
# will search for word disk. # will search for word disk.
_get_medium () { _get_medium () {
case "${COMP_WORDS[COMP_CWORD-2]}" in case "${COMP_WORDS[$COMP_CWORD-2]}" in
disk) disk)
_hdd_comp _hdd_comp
;; ;;
@@ -475,9 +475,9 @@ _VBoxManage() {
COMP_WORDBREAKS=${COMP_WORDBREAKS//|/} # remove pipe from comp word breaks COMP_WORDBREAKS=${COMP_WORDBREAKS//|/} # remove pipe from comp word breaks
COMPREPLY=() COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[$COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[$COMP_CWORD-1]}"
if [[ COMP_CWORD -ge 2 ]]; then if [[ $COMP_CWORD -ge 2 ]]; then
cmd="${COMP_WORDS[1]}" cmd="${COMP_WORDS[1]}"
if [[ $cmd == "-q" ]]; then if [[ $cmd == "-q" ]]; then
cmd="${COMP_WORDS[2]}" cmd="${COMP_WORDS[2]}"
@@ -507,13 +507,13 @@ _VBoxManage() {
;; ;;
bandwidthctl) bandwidthctl)
local items=(add set remove list) local items=( add list remove set )
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
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
add) add)
items=(--type --limit) items=(--type --limit)
@@ -524,7 +524,7 @@ _VBoxManage() {
if [[ ${prev} == "set" ]]; then if [[ ${prev} == "set" ]]; then
_bandwidthctl_comp _bandwidthctl_comp
else else
[[ " ${COMP_WORDS[@]} " != *" --limit "* ]] && \ [[ " ${COMP_WORDS[*]} " != *" --limit "* ]] && \
COMPREPLY=( $(compgen -W "--limit" -- \ COMPREPLY=( $(compgen -W "--limit" -- \
${cur}) ) ${cur}) )
fi fi
@@ -563,35 +563,30 @@ _VBoxManage() {
clonemedium) clonemedium)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "disk dvd floppy" -- ${cur}) ) _hdd_comp
_floppy_comp
_dvds_comp
elif [[ ${#COMP_WORDS[@]} -eq 4 ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else else
case "${prev}" in case "${prev}" in
disk) --format)
_hdd_comp COMPREPLY=( $(compgen -W "VDI VMDK VHD RAW" -- ${cur}) )
;; ;;
dvd) --variant)
_dvds_comp COMPREPLY=( $(compgen -W "Standard Fixed Split2G Stream
;; ESX" -- ${cur}) )
floppy)
_floppy_comp
;; ;;
*) *)
_find_item_name 2 items=( --existing --format --variant )
items=(--format --variant --existing) [[ " ${COMP_WORDS[*]} " != *" disk "* &&
" ${COMP_WORDS[*]} " != *" dvd "* &&
" ${COMP_WORDS[*]} " != *" floppy "* ]] &&
items+=(disk dvd floppy)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;;
case "${prev}" in
--format)
COMPREPLY=( $(compgen -W "VDI VMDK VHD RAW" --\
${cur}) )
;;
--variant)
COMPREPLY=( $(compgen -W "Standard Fixed Split2G
Stream ESX" -- ${cur}) )
;;
esac
;;
esac esac
fi fi
;; ;;
@@ -682,11 +677,12 @@ _VBoxManage() {
_cloudprofiles_comp _cloudprofiles_comp
;; ;;
list) list)
COMPREPLY=( $(compgen -W "instances images" -- ${cur}) ) COMPREPLY=( $(compgen -W "instances images vnicattachments"
-- ${cur}) )
;; ;;
instance) instance)
COMPREPLY=( $(compgen -W "create info terminate start COMPREPLY=( $(compgen -W "create info terminate start
pause" -- ${cur}) ) pause reset" -- ${cur}) )
;; ;;
image) image)
COMPREPLY=( $(compgen -W "create info delete import COMPREPLY=( $(compgen -W "create info delete import
@@ -697,6 +693,13 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "setup create" -- ${cur}) ) COMPREPLY=( $(compgen -W "setup create" -- ${cur}) )
fi fi
;; ;;
reset)
COMPREPLY=( $(compgen -W "--id" -- ${cur}) )
;;
vnicattachments)
COMPREPLY=( $(compgen -W "--compartment-id --filter"
-- ${cur}) )
;;
esac esac
if [[ " ${COMP_WORDS[*]} " == *" list images"* || if [[ " ${COMP_WORDS[*]} " == *" list images"* ||
" ${COMP_WORDS[*]} " == *" list instances"* ]]; then " ${COMP_WORDS[*]} " == *" list instances"* ]]; then
@@ -824,23 +827,21 @@ _VBoxManage() {
changeuartmode1 changeuartmode2 clipboard cpuexecutioncap changeuartmode1 changeuartmode2 clipboard cpuexecutioncap
draganddrop guestmemoryballoon keyboardputfile draganddrop guestmemoryballoon keyboardputfile
keyboardputscancode keyboardputstring natpf1 natpf2 natpf3 keyboardputscancode keyboardputstring natpf1 natpf2 natpf3
natpf4 natpf5 natpf6 natpf7 natpf8 natpf9 natpf1delete natpf4 natpf5 natpf6 natpf7 natpf8 natpf9 nic1 nic2 nic3 nic4
natpf2delete natpf3delete natpf4delete natpf5delete natpf6delete nic5 nic6 nic7 nic8 nicpromisc1 nicpromisc2 nicpromisc3
natpf7delete natpf8delete nic1 nic2 nic3 nic4 nic5 nic6 nic7 nicpromisc4 nicpromisc5 nicpromisc6 nicpromisc7 nicpromisc8
nic8 nicpromisc1 nicpromisc2 nicpromisc3 nicpromisc4 nicpromisc5 nicproperty1 nicproperty2 nicproperty3 nicproperty4 nicproperty5
nicpromisc6 nicpromisc7 nicpromisc8 nicproperty1 nicproperty2 nicproperty6 nicproperty7 nicproperty8 nictrace1 nictrace2
nicproperty3 nicproperty4 nicproperty5 nicproperty6 nicproperty7 nictrace3 nictrace4 nictrace5 nictrace6 nictrace7 nictrace8
nicproperty8 nictrace1 nictrace2 nictrace3 nictrace4 nictrace5 nictracefile1 nictracefile2 nictracefile3 nictracefile4
nictrace6 nictrace7 nictrace8 nictracefile1 nictracefile2 nictracefile5 nictracefile6 nictracefile7 nictracefile8 pause
nictracefile3 nictracefile4 nictracefile5 nictracefile6 plugcpu poweroff reboot recording removeallencpasswords
nictracefile7 nictracefile8 pause plugcpu poweroff reboot removeencpassword reset resume savestate screenshotpng
recording removeallencpasswords removeencpassword reset resume setcredentials setlinkstate1 setlinkstate2 setlinkstate3
savestate screenshotpng setcredentials setlinkstate1 setlinkstate4 setlinkstate5 setlinkstate6 setlinkstate7
setlinkstate2 setlinkstate3 setlinkstate4 setlinkstate5 setlinkstate8 setscreenlayout setvideomodehint shutdown teleport
setlinkstate6 setlinkstate7 setlinkstate8 setscreenlayout unplugcpu usbattach usbdetach vm-process-priority vrde vrdeport
setvideomodehint shutdown teleport unplugcpu usbattach usbdetach vrdeproperty vrdevideochannelquality webcam )
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))]}
@@ -937,9 +938,8 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
changeuartmode[1-2]) changeuartmode[1-2])
tmp=(disconnected serverpipe-name clientpipe-name tmp=(disconnected server client tcpserver tcpclient
tcpserverport tcpclienthostname:port filefilename file device-name)
device-name)
_get_excluded_items "${tmp[@]}" _get_excluded_items "${tmp[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
@@ -987,11 +987,12 @@ _VBoxManage() {
;; ;;
convertfromraw) convertfromraw)
local items=(--format --variant --uuid)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
elif [[ ${#COMP_WORDS[@]} -eq 4 ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else else
items=(--format --variant --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
@@ -1016,8 +1017,8 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
;; ;;
*) *)
[[ " ${COMP_WORDS[@]} " == *" --size "* || [[ " ${COMP_WORDS[*]} " == *" --size "* ||
" ${COMP_WORDS[@]} " == *" --sizebyte "* ]] && " ${COMP_WORDS[*]} " == *" --sizebyte "* ]] &&
items=(--filename --diffparent --format --variant) items=(--filename --diffparent --format --variant)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -1031,12 +1032,12 @@ _VBoxManage() {
_hdd_comp _hdd_comp
;; ;;
--format) --format)
COMPREPLY=( $(compgen -W "VDI VMDK VHD" --\ COMPREPLY=( $(compgen -W "VDI VMDK VHD" \
${cur}) ) -- ${cur}) )
;; ;;
--variant) --variant)
COMPREPLY=( $(compgen -W "Standard Fixed Split2G COMPREPLY=( $(compgen -W "Standard Fixed Split2G
Stream ESX Formatted" -- ${cur}) ) Stream ESX Formatted RawDisk" -- ${cur}) )
;; ;;
esac esac
;; ;;
@@ -1045,8 +1046,8 @@ _VBoxManage() {
;; ;;
createvm) createvm)
items=( --basefolder --ciphercipher --default --group --name --ostype items=( --basefolder --cipher --default --group --name --ostype
--password-idpassword-id --passwordfile --register --uuid ) --password-id --password --register --uuid )
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
else else
@@ -1065,7 +1066,7 @@ _VBoxManage() {
--basefolder) --basefolder)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;; ;;
--passwordfile) --password)
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
esac esac
@@ -1306,7 +1307,7 @@ _VBoxManage() {
if [[ " ${items[*]} " == *" $subcommand "* ]]; then if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
addpassword) addpassword)
items=( --passwordfile --password-id ) items=( --password --password-id )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
@@ -1317,15 +1318,15 @@ _VBoxManage() {
COMPREPLY=() COMPREPLY=()
;; ;;
setencryption) setencryption)
items=( --old-passwordfile --ciphercipher-identifier items=( --old-password --cipher
--new-passwordfile --new-password-id --force ) --new-password --new-password-id --force )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
esac esac
else else
case "$prev" in case "$prev" in
--new-passwordfile|--old-passwordfile|--passwordfile) --new-password|--old-password|--password)
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
*) *)
@@ -1421,203 +1422,148 @@ _VBoxManage() {
;; ;;
guestcontrol) guestcontrol)
local items=(run start copyfrom copyto mkdir createdir local items=( run start copyfrom copyto mkdir rmdir rm mv mktemp
createdirectory rmdir removedir removedirectory removefile rm mv stat list closeprocess closesession updatega watch )
move ren rename mktemp createtemp createtemporary stat list
closeprocess closesession updatega updateguestadditions
updateadditions watch)
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
run) run)
items=(--exe --timeout --unquoted-args items=( --arg0 --domain --dos2unix --exe
--ignore-operhaned-processes --profile --ignore-operhaned-processes --profile --putenv
--dos2unix --unix2dos --username --domain --) --quiet --timeout --unix2dos --unquoted-args
--username --verbose -- )
[[ " ${COMP_WORDS[@]} " != *" --password "* || [[ " ${COMP_WORDS[*]} " != *" --password "* ||
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] && " ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --putenv "* && [[ " ${COMP_WORDS[*]} " != *" --no-wait-stdout "* &&
" ${COMP_WORDS[@]} " != *" -E "* ]] && " ${COMP_WORDS[*]} " != *" --wait-stdout "* ]] &&
items+=(--putenv -E)
[[ " ${COMP_WORDS[@]} " != *" --no-wait-stdout "* &&
" ${COMP_WORDS[@]} " != *" --wait-stdout "* ]] &&
items+=(--no-wait-stdout --wait-stdout) items+=(--no-wait-stdout --wait-stdout)
[[ " ${COMP_WORDS[@]} " != *" --no-wait-stderr"* && [[ " ${COMP_WORDS[*]} " != *" --no-wait-stderr"* &&
" ${COMP_WORDS[@]} " != *" --wait-stderr "* ]] && " ${COMP_WORDS[*]} " != *" --wait-stderr "* ]] &&
items+=(--no-wait-stderr --wait-stderr) items+=(--no-wait-stderr --wait-stderr)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
start) start)
items=(--exe --timeout --unquoted-args items=( --arg0 --domain --exe
--ignore-operhaned-processes --profile --ignore-orphaned-processes --profile --putenv
--username --domain --passwordfile --password --) --quiet --timeout --unquoted-args --username
--verbose -- )
[[ " ${COMP_WORDS[@]} " != *" --password "* || [[ " ${COMP_WORDS[*]} " != *" --password "* ||
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] && " ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
copyfrom|copyto) copyfrom|copyto)
items=(--follow --target-directory --username items=( --dereference --domain --quiet --no-replace
--domain) --recursive --target-directory --update
--username --verbose )
[[ " ${COMP_WORDS[@]} " != *" --recursive "* && [[ " ${COMP_WORDS[*]} " != *" --password "* ||
" ${COMP_WORDS[@]} " != *" -R "* ]] && " ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
items+=(--recursive -R)
[[ " ${COMP_WORDS[@]} " != *" --password "* ||
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
createdirectory|createdir|mkdir) mkdir)
items=(--parents --mode --username --domain) items=( --domain --mode --parents --quiet
[[ " ${COMP_WORDS[@]} " != *" --password "* || --username --verbose )
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] && [[ " ${COMP_WORDS[*]} " != *" --password "* ||
" ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
removedir|removedirectory|rmdir) rmdir)
items=(--username --domain) items=( --domain --quiet --recursive --username
[[ " ${COMP_WORDS[@]} " != *" --password "* && --verbose )
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] && [[ " ${COMP_WORDS[*]} " != *" --password "* &&
" ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --recursive "* &&
" ${COMP_WORDS[@]} " != *" -R "* ]] &&
items+=(--recursive -R)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
removefile|rm) rm)
items=(--username --domain) items=( --domain --force --quiet --username
[[ " ${COMP_WORDS[@]} " != *" --force "* && --verbose )
" ${COMP_WORDS[@]} " != *" -f "* ]] && [[ " ${COMP_WORDS[*]} " != *" --password "* &&
items+=(--force -f) " ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
[[ " ${COMP_WORDS[@]} " != *" --password "* &&
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
rename|ren|move|mv) mv)
items=(--username --domain) items=( --domain --quiet --username --verbose )
[[ " ${COMP_WORDS[@]} " != *" --password "* && [[ " ${COMP_WORDS[*]} " != *" --password "* &&
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] && " ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
createtemporary|createtemp|mktemp) mktemp)
items=(--username --domain --secure --tmpdir --mode) items=( --directory --domain --mode --quiet --secure
[[ " ${COMP_WORDS[@]} " != *" --password "* && --tmpdir --username --verbose )
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] && [[ " ${COMP_WORDS[*]} " != *" --password "* &&
" ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
stat)
if [[ "${cur}" == "stat" ]]; then
COMPREPLY=( $(compgen -- ${cur}) )
else
items=( --domain --quiet --username --verbose )
[[ " ${COMP_WORDS[*]} " != *" --password "* &&
" ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password)
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
;;
list) list)
items=() items=( --quiet --verbose )
[[ " ${COMP_WORDS[@]} " != *" all "* && [[ " ${COMP_WORDS[*]} " != *" all "* &&
" ${COMP_WORDS[@]} " != *" sessions "* && " ${COMP_WORDS[*]} " != *" sessions "* &&
" ${COMP_WORDS[@]} " != *" processes "* && " ${COMP_WORDS[*]} " != *" processes "* &&
" ${COMP_WORDS[@]} " != *" files "* ]] && " ${COMP_WORDS[*]} " != *" files "* ]] &&
items+=(all sessions processes files) items+=(all sessions processes files)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
closeprocess) closeprocess)
items=() items=( --quiet --verbose )
[[ " ${COMP_WORDS[@]} " != *" --verbose "* && [[ " ${COMP_WORDS[*]} " != *" --session-id "* ]] &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
[[ " ${COMP_WORDS[@]} " != *" --session-id "* ]] &&
items+=(--session-name) items+=(--session-name)
[[ " ${COMP_WORDS[@]} " != *" --session-name "* ]] && [[ " ${COMP_WORDS[*]} " != *" --session-name "* ]] &&
items+=(--session-id) items+=(--session-id)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
@@ -1625,97 +1571,31 @@ _VBoxManage() {
;; ;;
closesession) closesession)
items=() items=( --quiet --verbose )
[[ " ${COMP_WORDS[@]} " != *" --verbose "* && [[ " ${COMP_WORDS[*]} " != *" --session-id "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] && " ${COMP_WORDS[*]} " != *" --session-name "* &&
items+=(--verbose -v) " ${COMP_WORDS[*]} " != *" --all "* ]] &&
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
[[ " ${COMP_WORDS[@]} " != *" --session-id "* &&
" ${COMP_WORDS[@]} " != *" --session-name "* &&
" ${COMP_WORDS[@]} " != *" --all "* ]] &&
items+=(--session-id --session-name --all) items+=(--session-id --session-name --all)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
process)
if [[ " ${COMP_WORDS[@]} " == *" process kill "* ]];
then
items=(--verbose)
[[ " ${COMP_WORDS[@]} " != *" --session-name "* &&
" ${COMP_WORDS[@]} " != *" --session-id "* ]] &&
items+=(--session-id --session-name)
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
else
_get_excluded_items "kill"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
;;
stat)
if [[ "${cur}" == "stat" ]]; then
COMPREPLY=( $(compgen -- ${cur}) )
else
items=(--username --domain --verbose)
[[ " ${COMP_WORDS[@]} " != *" --password "* &&
" ${COMP_WORDS[@]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
;;
updatega|updateguestadditions|updateadditions)
items=(--source --wait-start)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
updatega)
items=( --quiet --verbose --source --wait-start )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
watch) watch)
items=() items=( --quiet --verbose )
[[ " ${COMP_WORDS[@]} " != *" --verbose "* && _get_excluded_items "${items[@]}"
" ${COMP_WORDS[@]} " != *" -v "* ]] &&
items+=(--verbose -v)
[[ " ${COMP_WORDS[@]} " != *" --quiet "* &&
" ${COMP_WORDS[@]} " != *" -q "* ]] &&
items+=(--quiet -q)
_get_excluded_items "--verbose"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
esac esac
case "${prev}" in case "${prev}" in
close)
items=(--verbose)
[[ " ${COMP_WORDS[@]} " != *" --session-name "* &&
" ${COMP_WORDS[@]} " != *" --session-id "* &&
" ${COMP_WORDS[@]} " != *" --all "* ]] &&
items+=(--session-id --session-name --all)
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;;
--image)
COMPREPLY=( $(compgen -- ${cur}) )
;;
--target-directory|--tmpdir) --target-directory|--tmpdir)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;; ;;
@@ -1744,7 +1624,7 @@ _VBoxManage() {
if [[ "${prev}" == "${subcommand}" ]]; then if [[ "${prev}" == "${subcommand}" ]]; then
_vms_comp vms _vms_comp vms
elif [[ " ${items[@]} " == *" $subcommand "* ]]; then elif [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
get) get)
_get_excluded_items "--verbose" _get_excluded_items "--verbose"
@@ -1755,7 +1635,8 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
enumerate) enumerate)
_get_excluded_items "--patterns" _get_excluded_items "--no-timestamp --no-flags --relative
--old-format"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
wait) wait)
@@ -1780,18 +1661,18 @@ _VBoxManage() {
esac esac
if [[ ${#COMPREPLY[@]} -eq 0 && \ if [[ ${#COMPREPLY[@]} -eq 0 && \
" ${items[@]} " == *" $subcommand "* ]]; then " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
ipconfig) ipconfig)
items=(--dhcp --ip --ipv6 --netmask --netmasklengthv6) items=(--dhcp --ip --ipv6 --netmask --netmasklengthv6)
[[ " ${COMP_WORDS[@]} " == *" --dhcp "* ]] && items=() [[ " ${COMP_WORDS[*]} " == *" --dhcp "* ]] && items=()
[[ " ${COMP_WORDS[@]} " == *" --ip "* ]] && [[ " ${COMP_WORDS[*]} " == *" --ip "* ]] &&
items=(--netmask) items=(--netmask)
[[ " ${COMP_WORDS[@]} " == *" --netmask "* ]] && [[ " ${COMP_WORDS[*]} " == *" --netmask "* ]] &&
items=(--ip) items=(--ip)
[[ " ${COMP_WORDS[@]} " == *" --ipv6 "* ]] && [[ " ${COMP_WORDS[*]} " == *" --ipv6 "* ]] &&
items=(--netmasklengthv6) items=(--netmasklengthv6)
[[ " ${COMP_WORDS[@]} " == *" --netmasklengthv6 "* ]] && [[ " ${COMP_WORDS[*]} " == *" --netmasklengthv6 "* ]] &&
items=(--ipv6) items=(--ipv6)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
@@ -1846,7 +1727,7 @@ _VBoxManage() {
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;; ;;
--eula)= --eula)
COMPREPLY=( $(compgen -W "show accept" -- ${cur}) ) COMPREPLY=( $(compgen -W "show accept" -- ${cur}) )
;; ;;
--settingsfile) --settingsfile)
@@ -1919,7 +1800,7 @@ _VBoxManage() {
disk|dvd|floppy) disk|dvd|floppy)
COMPREPLY=( $(compgen -W "get set delete" -- ${cur}) ) COMPREPLY=( $(compgen -W "get set delete" -- ${cur}) )
;; ;;
get|set|floppy) get|set|delete)
_get_medium _get_medium
;; ;;
esac esac
@@ -1927,9 +1808,9 @@ _VBoxManage() {
;; ;;
metrics) metrics)
items=(list setup query enable disable collect) items=( collect disable enable list query setup )
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
if [[ " ${items[@]} " == *" $subcommand "* ]]; then if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
list|query) list|query)
if [[ "${subcommand}" == "${prev}" ]]; then if [[ "${subcommand}" == "${prev}" ]]; then
@@ -1998,7 +1879,7 @@ _VBoxManage() {
*) *)
_find_item_name 2 _find_item_name 2
items=( --autoreset --compact --description --move items=( --autoreset --compact --description --move
--property --setlocation --type ) --property --property-file --setlocation --type )
[[ " ${COMP_WORDS[*]} " != *" --resize "* && [[ " ${COMP_WORDS[*]} " != *" --resize "* &&
" ${COMP_WORDS[*]} " != *" --resizebyte"* ]] && " ${COMP_WORDS[*]} " != *" --resizebyte"* ]] &&
items+=( --resizebyte --resize ) items+=( --resizebyte --resize )
@@ -2016,7 +1897,7 @@ _VBoxManage() {
--move) --move)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;; ;;
--setlocation) --setlocation|--property-file)
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
esac esac
@@ -2027,7 +1908,7 @@ _VBoxManage() {
modifynvram) modifynvram)
items=( changevar deletevar enrollmssignatures enrollorclpk items=( changevar deletevar enrollmssignatures enrollorclpk
enrollpk inituefivarstore listvars queryvar ) enrollpk enrollmok inituefivarstore listvars queryvar )
# _get_excluded_items "${items[@]}" # _get_excluded_items "${items[@]}"
# COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) # COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -2048,6 +1929,15 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi fi
;; ;;
enrollmok)
if [ "${prev}" = "--mok" ]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else
items=( --mok --owner-uuid )
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi
;;
queryvar|changevar) queryvar|changevar)
if [ "${prev}" = "--filename" ]; then if [ "${prev}" = "--filename" ]; then
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
@@ -2319,9 +2209,9 @@ _VBoxManage() {
;; ;;
--uart-mode[1-2]) --uart-mode[1-2])
COMPREPLY=( $(compgen -W "disconnected serverpipe COMPREPLY=( $(compgen -W "disconnected server
clientpipe tcpserverport tcpclienthostname:port client tcpserver tcpclient
filefilename device-name" -- ${cur}) ) file device-name" -- ${cur}) )
;; ;;
--uart-type[1-2]) --uart-type[1-2])
@@ -2463,20 +2353,20 @@ _VBoxManage() {
;; ;;
natnetwork) natnetwork)
items=(add remove modify start stop list) items=( add list modify remove start stop )
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
if [[ "${prev}" == "--netname" ]]; then if [[ "${prev}" == "--netname" ]]; then
_natnet_comp _natnet_comp
elif [[ "${prev}" == "--dhcp" ]]; then elif [[ "${prev}" == "--dhcp" || "${prev}" == "--ipv6" ]]; then
COMPREPLY=( $(compgen -W "on off" -- ${cur}) ) COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
elif [[ " ${items[@]} " == *" $subcommand "* ]]; then elif [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
add|modify) add|modify)
items=(--netname --network --dhcp --port-forward-4 items=(--netname --network --dhcp --port-forward-4
--loopback-4 --ipv6 --port-forward-6 --loopback-6) --loopback-4 --ipv6 --port-forward-6 --loopback-6)
[[ " ${COMP_WORDS[@]} " != *" --enable"* && [[ " ${COMP_WORDS[*]} " != *" --enable"* &&
" ${COMP_WORDS[@]} " != *" --disable"* ]] && " ${COMP_WORDS[*]} " != *" --disable"* ]] &&
items+=(--enable --disable) items+=(--enable --disable)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
@@ -2502,10 +2392,10 @@ _VBoxManage() {
[[ ${#COMPREPLY[@]} = 1 && "${COMPREPLY[0]}" != *".vbox" ]] && \ [[ ${#COMPREPLY[@]} = 1 && "${COMPREPLY[0]}" != *".vbox" ]] && \
COMPREPLY[0]="${COMPREPLY[0]}/" COMPREPLY[0]="${COMPREPLY[0]}/"
else else
if [[ $prev == "--passwordfile" ]]; then if [[ $prev == "--password" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
else else
local items=( --passwordfile ) local items=( --password )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi fi
@@ -2620,12 +2510,12 @@ _VBoxManage() {
_vms_comp vms _vms_comp vms
else else
local items=( --details --machinereadable --log --password-id local items=( --details --machinereadable --log --password-id
--password --password-idid --passwordfile ) --password )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in case "${prev}" in
--log|--passwordfile) --log|--password)
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
esac esac
@@ -2676,7 +2566,7 @@ _VBoxManage() {
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
take) take)
items=(--description --live --uniquename) items=(--description --live --uniquename)
@@ -2726,10 +2616,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 elif [[ "${prev}" == "--password" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
else else
items=( --type --putenv --passwordfile --password-id ) items=( --type --putenv --password --password-id )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
fi fi
@@ -2740,17 +2630,21 @@ _VBoxManage() {
_vms_comp vms _vms_comp vms
else else
_find_item_name 2 _find_item_name 2
local items=(--storagectl --port --device --type --medium --mtype local items=( --bandwidthgroup --comment --device --discard
--comment --setuuid --setparentuuid --passthrough --tempeject --encodedlun --forceunmount --hotpluggable --initiator --intnet
--nonrotational --discard --hotpluggable --bandwidthgroup --lun --medium --mtype --nonrotational --passthrough --password
--forceunmount --server --target --tport --lun --encodedlun --passwordfile --port --server --setparentuuid --setuuid
--username --password --initiator --intnet --passwordfile) --storagectl --target --tempeject --tport --type --username )
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in case "${prev}" in
--type) --bandwidthgroup)
COMPREPLY=( $(compgen -W "dvddrive hdd fdd" -- ${cur}) ) COMPREPLY=( $(compgen -W "none" -- ${cur}) )
;;
--discard|--hotpluggable|--nonrotational|--passthrough|\
--tempeject)
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;; ;;
--medium) --medium)
COMPREPLY=() COMPREPLY=()
@@ -2767,19 +2661,19 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "normal writethrough immutable COMPREPLY=( $(compgen -W "normal writethrough immutable
shareable readonly multiattach" -- ${cur}) ) shareable readonly multiattach" -- ${cur}) )
;; ;;
--passthrough|--tempeject|--nonrotational|--discard)
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;;
--passwordfile) --passwordfile)
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
--type)
COMPREPLY=( $(compgen -W "dvddrive hdd fdd" -- ${cur}) )
;;
esac esac
fi fi
;; ;;
storagectl) storagectl)
local items=(--name --add --controller --portcount --hostiocache local items=( --add --bootable --controller --hostiocache --name
--bootable --rename --remove) --portcount --remove --rename )
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
else else
@@ -2787,12 +2681,13 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in case "${prev}" in
--add) --add)
COMPREPLY=( $(compgen -W "ide sata scsi floppy COMPREPLY=( $(compgen -W "floppy ide pcie sas sata scsi
sas usb pcie" -- ${cur}) ) usb" -- ${cur}) )
;; ;;
--controller) --controller)
COMPREPLY=( $(compgen -W "LSILogic LSILogicSAS BusLogic COMPREPLY=( $(compgen -W "BusLogic I82078 ICH6 IntelAhci
IntelAHCI PIIX3 PIIX4 ICH6 I82078 USB NVMe" -- ${cur}) ) LSILogic LSILogicSAS NVMe PIIX3 PIIX4 USB VirtIO" \
-- ${cur}) )
;; ;;
--bootable|--hostiocache) --bootable|--hostiocache)
COMPREPLY=( $(compgen -W "on off" -- ${cur}) ) COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
@@ -2802,7 +2697,7 @@ _VBoxManage() {
;; ;;
unattended) unattended)
if [[ COMP_CWORD -ge 3 ]]; then if [[ $COMP_CWORD -ge 3 ]]; then
subcommand="${COMP_WORDS[2]}" subcommand="${COMP_WORDS[2]}"
if [[ $subcommand == "${cmd}" ]]; then if [[ $subcommand == "${cmd}" ]]; then
subcommand="${COMP_WORDS[3]}" subcommand="${COMP_WORDS[3]}"
@@ -2899,7 +2794,7 @@ _VBoxManage() {
;; ;;
usbdevsource) usbdevsource)
if [[ COMP_CWORD -ge 3 ]]; then if [[ $COMP_CWORD -ge 3 ]]; then
subcommand="${COMP_WORDS[2]}" subcommand="${COMP_WORDS[2]}"
if [[ $subcommand == "${cmd}" ]]; then if [[ $subcommand == "${cmd}" ]]; then
subcommand="${COMP_WORDS[3]}" subcommand="${COMP_WORDS[3]}"
@@ -2922,7 +2817,7 @@ _VBoxManage() {
;; ;;
usbfilter) usbfilter)
if [[ COMP_CWORD -ge 3 ]]; then if [[ $COMP_CWORD -ge 3 ]]; then
subcommand="${COMP_WORDS[2]}" subcommand="${COMP_WORDS[2]}"
if [[ $subcommand == "${cmd}" ]]; then if [[ $subcommand == "${cmd}" ]]; then
subcommand="${COMP_WORDS[3]}" subcommand="${COMP_WORDS[3]}"
@@ -2948,8 +2843,9 @@ _VBoxManage() {
case "${subcommand}" in case "${subcommand}" in
add|modify) add|modify)
local items=(--target --name --action --active local items=(--target --name --action --active
--vendorid --productid --revision --manufacturer --vendorid --productid --port --revision
--product --remote --serialnumber --maskedinterfaces) --manufacturer --product --remote --serialnumber
--maskedinterfaces)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;