Removed unnecessary passed argument for most functions

This commit is contained in:
2015-05-10 16:23:55 +02:00
parent 9c7e076acb
commit c3c344b31f

View File

@@ -43,7 +43,6 @@ _VBoxManage() {
# other characters which usually are treated as IFS - like space. Pipe # other characters which usually are treated as IFS - like space. Pipe
# character used in disk filename will ruin this completions. # character used in disk filename will ruin this completions.
_hdd_comp() { _hdd_comp() {
local cur=$1
local hdds local hdds
local item local item
@@ -63,7 +62,6 @@ _VBoxManage() {
} }
_floppy_comp() { _floppy_comp() {
local cur=$1
local floppies local floppies
local item local item
@@ -82,7 +80,6 @@ _VBoxManage() {
} }
_dvds_comp() { _dvds_comp() {
local cur=$1
local dvds local dvds
local item local item
@@ -104,7 +101,6 @@ _VBoxManage() {
# Issues are the same as in above function. # Issues are the same as in above function.
_vms_comp() { _vms_comp() {
local command=$1 local command=$1
local cur=$2
local vms local vms
local item local item
@@ -122,8 +118,6 @@ _VBoxManage() {
} }
_vms_state_comp() { _vms_state_comp() {
local command=$1
local cur=$2
local vms local vms
local item local item
@@ -143,23 +137,7 @@ _VBoxManage() {
done done
} }
_list_comp() {
local cur=$1
local list
list=$(VBoxManage list | \
grep '|' | \
sed 's/\[.*\]//g'| \
sed 's/VBoxManage list//' | \
tr "\\n" " " | \
sed 's/$/\n/' | \
sed 's/\s\+//g' | \
sed 's/|/ /g')
COMPREPLY=( $(compgen -W "$list" -- ${cur}) )
}
_group_comp() { _group_comp() {
local cur=$1
local list local list
local item local item
@@ -177,7 +155,6 @@ _VBoxManage() {
} }
_os_comp() { _os_comp() {
local cur=$1
local list local list
local item local item
@@ -195,7 +172,6 @@ _VBoxManage() {
} }
_dhcp_comp() { _dhcp_comp() {
local cur=$1
local list local list
local item local item
@@ -214,7 +190,6 @@ _VBoxManage() {
} }
_hostonlyif_comp() { _hostonlyif_comp() {
local cur=$1
local list local list
local item local item
@@ -233,7 +208,7 @@ _VBoxManage() {
} }
_bandwidthctl_comp() { _bandwidthctl_comp() {
local rules cur=$1 local rules
local item local item
_find_item_name 2 _find_item_name 2
@@ -253,7 +228,7 @@ _VBoxManage() {
} }
_snapshot_comp() { _snapshot_comp() {
local snap cur=$1 local snap
local item local item
_find_item_name 2 _find_item_name 2
@@ -274,7 +249,7 @@ _VBoxManage() {
} }
_webcam_comp() { _webcam_comp() {
local devs cur=$1 local devs
local item local item
_find_item_name 2 _find_item_name 2
@@ -291,7 +266,7 @@ _VBoxManage() {
} }
_webcam_avail_comp() { _webcam_avail_comp() {
local devs cur=$1 local devs
local item local item
_find_item_name 2 _find_item_name 2
@@ -321,8 +296,7 @@ _VBoxManage() {
} }
_sharedfolder_comp() { _sharedfolder_comp() {
local vm=$1 local vm="$@"
local cur=$2
local folders local folders
local item local item
@@ -342,7 +316,6 @@ _VBoxManage() {
} }
_natnet_comp() { _natnet_comp() {
local cur=$1
local list local list
local item local item
@@ -361,7 +334,6 @@ _VBoxManage() {
} }
_bridgedif_comp() { _bridgedif_comp() {
local cur=$1
local list local list
local item local item
@@ -380,7 +352,6 @@ _VBoxManage() {
} }
_intnet_comp() { _intnet_comp() {
local cur=$1
local list local list
local item local item
@@ -429,12 +400,12 @@ _VBoxManage() {
_find_item_name 2 _find_item_name 2
COMPREPLY=() COMPREPLY=()
[[ -z "${name}" ]] && [[ -z "${name}" ]] &&
_vms_state_comp ${cur} _vms_state_comp
;; ;;
bandwidthctl) bandwidthctl)
local items=(add set remove list) local items=(add set remove list)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
_find_item_name 2 _find_item_name 2
subcommand=${COMP_WORDS[$((index+1))]} subcommand=${COMP_WORDS[$((index+1))]}
@@ -447,7 +418,7 @@ _VBoxManage() {
;; ;;
set) set)
if [[ ${prev} == "set" ]]; then if [[ ${prev} == "set" ]]; then
_bandwidthctl_comp ${cur} _bandwidthctl_comp
else else
[[ " ${COMP_WORDS[@]} " != *" --limit "* ]] && \ [[ " ${COMP_WORDS[@]} " != *" --limit "* ]] && \
COMPREPLY=( $(compgen -W "--limit" -- \ COMPREPLY=( $(compgen -W "--limit" -- \
@@ -456,7 +427,7 @@ _VBoxManage() {
;; ;;
remove) remove)
if [[ ${prev} == "remove" ]]; then if [[ ${prev} == "remove" ]]; then
_bandwidthctl_comp ${cur} _bandwidthctl_comp
fi fi
;; ;;
list) list)
@@ -479,7 +450,7 @@ _VBoxManage() {
;; ;;
clonehd) clonehd)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_hdd_comp ${cur} _hdd_comp
else else
_find_item_name 2 _find_item_name 2
items=(--format --variant --existing) items=(--format --variant --existing)
@@ -499,7 +470,7 @@ _VBoxManage() {
;; ;;
clonevm) clonevm)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
_find_item_name 2 _find_item_name 2
items=(--snapshot --mode --options --name --groups --basefolder items=(--snapshot --mode --options --name --groups --basefolder
@@ -509,7 +480,7 @@ _VBoxManage() {
case "${prev}" in case "${prev}" in
--snapshot) --snapshot)
COMPREPLY=() COMPREPLY=()
_snapshot_comp ${cur} _snapshot_comp
;; ;;
--mode) --mode)
COMPREPLY=( $(compgen -W "machine machineandchildren COMPREPLY=( $(compgen -W "machine machineandchildren
@@ -521,7 +492,7 @@ _VBoxManage() {
;; ;;
--groups) --groups)
COMPREPLY=() COMPREPLY=()
_group_comp ${cur} _group_comp
;; ;;
--basefolder) --basefolder)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
@@ -535,13 +506,13 @@ _VBoxManage() {
else else
case "${prev}" in case "${prev}" in
disk) disk)
_hdd_comp ${cur} _hdd_comp
;; ;;
dvd) dvd)
_dvds_comp ${cur} _dvds_comp
;; ;;
floppy) floppy)
_floppy_comp ${cur} _floppy_comp
;; ;;
*) *)
items=(--delete) items=(--delete)
@@ -553,7 +524,7 @@ _VBoxManage() {
;; ;;
controlvm) controlvm)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp runningvms ${cur} _vms_comp runningvms
else else
local items=(acpipowerbutton acpisleepbutton clipboard local items=(acpipowerbutton acpisleepbutton clipboard
cpuexecutioncap draganddrop guestmemoryballoon cpuexecutioncap draganddrop guestmemoryballoon
@@ -639,9 +610,9 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "attach detach COMPREPLY=( $(compgen -W "attach detach
list" -- ${cur}) ) list" -- ${cur}) )
[[ ${prev} == "detach" ]] && \ [[ ${prev} == "detach" ]] && \
_webcam_comp ${cur} _webcam_comp
[[ ${prev} == "attach" ]] && \ [[ ${prev} == "attach" ]] && \
_webcam_avail_comp ${cur} _webcam_avail_comp
;; ;;
esac esac
else else
@@ -686,7 +657,7 @@ _VBoxManage() {
;; ;;
--diffparent) --diffparent)
COMPREPLY=() COMPREPLY=()
_hdd_comp ${cur} _hdd_comp
;; ;;
--format) --format)
COMPREPLY=( $(compgen -W "VDI VMDK VHD" -- ${cur}) ) COMPREPLY=( $(compgen -W "VDI VMDK VHD" -- ${cur}) )
@@ -709,11 +680,11 @@ _VBoxManage() {
case "${prev}" in case "${prev}" in
--groups) --groups)
COMPREPLY=() COMPREPLY=()
_group_comp ${cur} _group_comp
;; ;;
--ostype) --ostype)
COMPREPLY=() COMPREPLY=()
_os_comp ${cur} _os_comp
;; ;;
--basefolder) --basefolder)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
@@ -729,7 +700,7 @@ _VBoxManage() {
items=(dumpguestcore info injectnmi log logdest logflags osdetect items=(dumpguestcore info injectnmi log logdest logflags osdetect
osinfo getregisters setregisters show statistics) osinfo getregisters setregisters show statistics)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp runningvms ${cur} _vms_comp runningvms
else else
_find_item_name 2 _find_item_name 2
subcommand=${COMP_WORDS[$((index+1))]} subcommand=${COMP_WORDS[$((index+1))]}
@@ -793,11 +764,11 @@ _VBoxManage() {
case "${prev}" in case "${prev}" in
--netname) --netname)
COMPREPLY=() COMPREPLY=()
_dhcp_comp ${cur} _dhcp_comp
;; ;;
--ifname) --ifname)
COMPREPLY=() COMPREPLY=()
_hostonlyif_comp ${cur} _hostonlyif_comp
;; ;;
esac esac
@@ -818,12 +789,12 @@ _VBoxManage() {
_find_item_name 2 _find_item_name 2
COMPREPLY=() COMPREPLY=()
[[ -z "${name}" ]] && [[ -z "${name}" ]] &&
_vms_state_comp ${cur} _vms_state_comp
;; ;;
"export") "export")
items=( --manifest --iso --options --vsys) items=( --manifest --iso --options --vsys)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
[[ " ${COMP_WORDS[@]} " != *" -o "* && [[ " ${COMP_WORDS[@]} " != *" -o "* &&
" ${COMP_WORDS[@]} " != *" --output "* ]] && " ${COMP_WORDS[@]} " != *" --output "* ]] &&
@@ -877,7 +848,7 @@ _VBoxManage() {
getextradata) getextradata)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "global" -- ${cur}) ) COMPREPLY=( $(compgen -W "global" -- ${cur}) )
_vms_comp vms ${cur} _vms_comp vms
else else
_get_excluded_items "enumerate" _get_excluded_items "enumerate"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -890,7 +861,7 @@ _VBoxManage() {
stat updateadditions watch) stat updateadditions watch)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp runningvms ${cur} _vms_comp runningvms
else else
_find_item_name 2 _find_item_name 2
subcommand=${COMP_WORDS[$((index+1))]} subcommand=${COMP_WORDS[$((index+1))]}
@@ -1054,7 +1025,7 @@ _VBoxManage() {
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
if [[ "${prev}" == "${subcommand}" ]]; then if [[ "${prev}" == "${subcommand}" ]]; then
_vms_comp vms ${cur} _vms_comp vms
elif [[ " ${items[@]} " == *" $subcommand "* ]]; then elif [[ " ${items[@]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
get) get)
@@ -1085,7 +1056,7 @@ _VBoxManage() {
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
case "${prev}" in case "${prev}" in
ipconfig|remove) ipconfig|remove)
_hostonlyif_comp ${cur} _hostonlyif_comp
;; ;;
esac esac
@@ -1156,7 +1127,7 @@ _VBoxManage() {
case "${subcommand}" in case "${subcommand}" in
list|query) list|query)
if [[ "${subcommand}" == "${prev}" ]]; then if [[ "${subcommand}" == "${prev}" ]]; then
_vms_comp vms ${cur} _vms_comp vms
items=(host) items=(host)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY+=( $(compgen -W '$result' -- ${cur}) ) COMPREPLY+=( $(compgen -W '$result' -- ${cur}) )
@@ -1164,7 +1135,7 @@ _VBoxManage() {
;; ;;
setup) setup)
if [[ "${subcommand}" == "${prev}" ]]; then if [[ "${subcommand}" == "${prev}" ]]; then
_vms_comp vms ${cur} _vms_comp vms
items=(host) items=(host)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY+=( $(compgen -W '$result' -- ${cur}) ) COMPREPLY+=( $(compgen -W '$result' -- ${cur}) )
@@ -1176,7 +1147,7 @@ _VBoxManage() {
;; ;;
enable|disable) enable|disable)
if [[ "${subcommand}" == "${prev}" ]]; then if [[ "${subcommand}" == "${prev}" ]]; then
_vms_comp vms ${cur} _vms_comp vms
items=(host) items=(host)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY+=( $(compgen -W '$result' -- ${cur}) ) COMPREPLY+=( $(compgen -W '$result' -- ${cur}) )
@@ -1187,7 +1158,7 @@ _VBoxManage() {
;; ;;
collect) collect)
if [[ "${subcommand}" == "${prev}" ]]; then if [[ "${subcommand}" == "${prev}" ]]; then
_vms_comp vms ${cur} _vms_comp vms
items=(host) items=(host)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY+=( $(compgen -W '$result' -- ${cur}) ) COMPREPLY+=( $(compgen -W '$result' -- ${cur}) )
@@ -1207,7 +1178,7 @@ _VBoxManage() {
;; ;;
modifyhd) modifyhd)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_hdd_comp ${cur} _hdd_comp
else else
_find_item_name 2 _find_item_name 2
items=(--type --autoreset --property --compact --resize) items=(--type --autoreset --property --compact --resize)
@@ -1297,18 +1268,18 @@ _VBoxManage() {
--defaultfrontend) --defaultfrontend)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in case "${prev}" in
--groups) --groups)
COMPREPLY=() COMPREPLY=()
_group_comp ${cur} _group_comp
;; ;;
--ostype) --ostype)
COMPREPLY=() COMPREPLY=()
_os_comp ${cur} _os_comp
;; ;;
--pagefusion|--acpi|--ioapic|--hpet|--triplefaultreset|\ --pagefusion|--acpi|--ioapic|--hpet|--triplefaultreset|\
--hwvirtex|--nestedpaging|--largepages|--vtxvpid|--vtxux|\ --hwvirtex|--nestedpaging|--largepages|--vtxvpid|--vtxux|\
@@ -1367,33 +1338,33 @@ _VBoxManage() {
;; ;;
--nicbandwidthgroup[1-8]) --nicbandwidthgroup[1-8])
COMPREPLY=() COMPREPLY=()
_bandwidthctl_comp ${cur} _bandwidthctl_comp
_get_excluded_items "none" _get_excluded_items "none"
COMPREPLY+=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY+=( $(compgen -W "$result" -- ${cur}) )
;; ;;
--bridgeadapter[1-8]) --bridgeadapter[1-8])
COMPREPLY=() COMPREPLY=()
_bridgedif_comp ${cur} _bridgedif_comp
_get_excluded_items "none" _get_excluded_items "none"
COMPREPLY+=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY+=( $(compgen -W "$result" -- ${cur}) )
;; ;;
--hostonlyadapter[1-8]) --hostonlyadapter[1-8])
COMPREPLY=() COMPREPLY=()
_hostonlyif_comp ${cur} _hostonlyif_comp
_get_excluded_items "none" _get_excluded_items "none"
COMPREPLY+=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY+=( $(compgen -W "$result" -- ${cur}) )
;; ;;
--intnet[1-8]) --intnet[1-8])
COMPREPLY=() COMPREPLY=()
_intnet_comp ${cur} _intnet_comp
;; ;;
--nat-network[1-8]) --nat-network[1-8])
COMPREPLY=() COMPREPLY=()
_natnet_comp ${cur} _natnet_comp
;; ;;
--natnet[1-8]) --natnet[1-8])
COMPREPLY=() COMPREPLY=()
_natnet_comp ${cur} _natnet_comp
;; ;;
--natpf[1-8]) --natpf[1-8])
COMPREPLY+=( $(compgen -W "delete" -- ${cur}) ) COMPREPLY+=( $(compgen -W "delete" -- ${cur}) )
@@ -1453,7 +1424,7 @@ _VBoxManage() {
items=(add remove modify start stop) items=(add remove modify start stop)
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
if [[ "${prev}" == "--netname" ]]; then if [[ "${prev}" == "--netname" ]]; then
_natnet_comp ${cur} _natnet_comp
elif [[ "${prev}" == "--dhcp" ]]; then elif [[ "${prev}" == "--dhcp" ]]; then
COMPREPLY=( $(compgen -W "on off" -- ${cur}) ) COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
elif [[ " ${items[@]} " == *" $subcommand "* ]]; then elif [[ " ${items[@]} " == *" $subcommand "* ]]; then
@@ -1492,7 +1463,7 @@ _VBoxManage() {
setextradata) setextradata)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "global" -- ${cur}) ) COMPREPLY=( $(compgen -W "global" -- ${cur}) )
_vms_comp vms ${cur} _vms_comp vms
fi fi
;; ;;
setproperty) setproperty)
@@ -1533,7 +1504,7 @@ _VBoxManage() {
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
case "${prev}" in case "${prev}" in
add|remove) add|remove)
_vms_comp vms ${cur} _vms_comp vms
;; ;;
--hostpath) --hostpath)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
@@ -1541,7 +1512,7 @@ _VBoxManage() {
--name) --name)
if [[ ${subcommand} == "remove" ]]; then if [[ ${subcommand} == "remove" ]]; then
_find_item_name 3 _find_item_name 3
_sharedfolder_comp "${name}" "${cur}" _sharedfolder_comp "${name}"
fi fi
;; ;;
esac esac
@@ -1566,12 +1537,12 @@ _VBoxManage() {
;; ;;
showhdinfo) showhdinfo)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_hdd_comp ${cur} _hdd_comp
fi fi
;; ;;
showvminfo) showvminfo)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
if [[ " ${COMP_WORDS[@]} " == *" --log "* ]]; then if [[ " ${COMP_WORDS[@]} " == *" --log "* ]]; then
COMPREPLY=() COMPREPLY=()
@@ -1590,7 +1561,7 @@ _VBoxManage() {
snapshot) snapshot)
items=(take delete restore restorecurrent edit list showvminfo) items=(take delete restore restorecurrent edit list showvminfo)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
_find_item_name 2 _find_item_name 2
subcommand=${COMP_WORDS[$((index+1))]} subcommand=${COMP_WORDS[$((index+1))]}
@@ -1602,7 +1573,7 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
delete|restore|showvminfo) delete|restore|showvminfo)
_snapshot_comp ${cur} _snapshot_comp
;; ;;
restorecurrent) restorecurrent)
COMPREPLY=() COMPREPLY=()
@@ -1610,7 +1581,7 @@ _VBoxManage() {
edit) edit)
if [[ ${prev} == "edit" && if [[ ${prev} == "edit" &&
${#COMP_WORDS[@]} == 5 ]]; then ${#COMP_WORDS[@]} == 5 ]]; then
_snapshot_comp ${cur} _snapshot_comp
COMPREPLY+=("--current") COMPREPLY+=("--current")
else else
items=(--name --description) items=(--name --description)
@@ -1632,7 +1603,7 @@ _VBoxManage() {
;; ;;
startvm) startvm)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
elif [[ "${prev}" == "--type" ]]; then elif [[ "${prev}" == "--type" ]]; then
COMPREPLY=( $(compgen -W "gui sdl headless" -- ${cur}) ) COMPREPLY=( $(compgen -W "gui sdl headless" -- ${cur}) )
else else
@@ -1643,7 +1614,7 @@ _VBoxManage() {
;; ;;
storageattach) storageattach)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
_find_item_name 2 _find_item_name 2
local items=(--storagectl --port --device --type --medium --mtype local items=(--storagectl --port --device --type --medium --mtype
@@ -1661,9 +1632,9 @@ _VBoxManage() {
--medium) --medium)
COMPREPLY=() COMPREPLY=()
local tmp=(none emptydrive additions) local tmp=(none emptydrive additions)
_hdd_comp ${cur} _hdd_comp
_floppy_comp ${cur} _floppy_comp
_dvds_comp ${cur} _dvds_comp
for item in "${tmp[@]}" for item in "${tmp[@]}"
do do
[[ ${item^^} == ${cur^^}* ]] && COMPREPLY+=("$item") [[ ${item^^} == ${cur^^}* ]] && COMPREPLY+=("$item")
@@ -1683,7 +1654,7 @@ _VBoxManage() {
local items=(--name --add --controller --portcount --hostiocache local items=(--name --add --controller --portcount --hostiocache
--bootable --remove) --bootable --remove)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -1704,7 +1675,7 @@ _VBoxManage() {
;; ;;
unregistervm) unregistervm)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms ${cur} _vms_comp vms
else else
local items=(--delete) local items=(--delete)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
@@ -1724,7 +1695,7 @@ _VBoxManage() {
else else
case "${prev}" in case "${prev}" in
--target) --target)
_vms_comp vms ${cur} _vms_comp vms
COMPREPLY+=( $(compgen -W "global" -- ${cur}) ) COMPREPLY+=( $(compgen -W "global" -- ${cur}) )
;; ;;
--action) --action)