2 Commits

Author SHA1 Message Date
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
2 changed files with 96 additions and 218 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.4, 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.4
_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
@@ -1417,203 +1417,147 @@ _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=( --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=( --domain --exe --ignore-orphaned-processes
--ignore-operhaned-processes --profile --profile --putenv --quiet --timeout
--username --domain --passwordfile --password --) --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=( --domain --mode --quiet --secure --tmpdir
[[ " ${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}) )
;; ;;
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[@]}"
@@ -1621,97 +1565,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}) )
;; ;;
@@ -1777,18 +1655,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[@]}"
@@ -1843,7 +1721,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)
@@ -1924,9 +1802,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
@@ -2460,20 +2338,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[@]}"
@@ -2673,7 +2551,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)