11 Commits

Author SHA1 Message Date
c8301459df Command extapck will be available on topmost completion again. 2019-12-22 19:06:05 +01:00
ab0cc7aea4 Fixes for modifyvm options completion. 2019-12-22 19:03:09 +01:00
f73e80c7ad Fixed list command 2019-12-22 19:03:09 +01:00
10900543fa Bump to version 6.0.12.
Changed videocap to recording in modifyvm and controlvm, changed from
usb to usbohci in modifyvm command, added new movevm and mediumio
commands and cloud related options.
2019-12-22 19:02:50 +01:00
1be3e589d4 Bump to 5.2.32 version 2019-09-16 07:24:42 +02:00
9c5b048c62 Bump to 5.2.26
Added guesttohost and bidirectional parameters for --draganddrop option
for both: controlvm and modifyvm.
2019-04-23 19:14:39 +02:00
5fd18d7cec Removed redundant --videocapopts from modifyvm 2019-04-23 19:14:39 +02:00
05af06f337 Merge pull request #7 from schplurtz/comp_words
change comp_words to upper case
2019-02-19 19:21:21 +01:00
cde78c8e4c Merge pull request #6 from schplurtz/snaplist
handle snapshot completion entirely with awk
2019-02-19 19:19:39 +01:00
Schplurtz le Déboulonné
197c46cd35 change comp_words to upper case 2019-02-19 10:58:37 +01:00
Christophe Martin
296be19560 handle snapshot completion entirely with awk
fixes #5
Also list and complete snapshot uuid.
2019-02-19 10:41:23 +01:00
2 changed files with 175 additions and 84 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
5.2.22, and supports all commands (in some extent ;)). 6.0.12, 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: 5.2.22 # Version: 6.0.12
_VBoxManage() { _VBoxManage() {
local cur prev opts cmd subcommand tmp items name index result local cur prev opts cmd subcommand tmp items name index result
@@ -271,11 +271,14 @@ _VBoxManage() {
snap=$(VBoxManage snapshot "${name//\\/}" \ snap=$(VBoxManage snapshot "${name//\\/}" \
list | \ list | \
grep UUID | grep UUID |
awk -F ': ' '{print $2}' | \ awk -F ': *' -v ORS='|' '/UUID: / {
sed 's/ (.*//' | \ n=$2; u=$3
tr '\n' '|' | \ sub(/..UUID/, "", n)
sed 's/|$//' | \ gsub(/ /, "\\ ", n);
sed 's/\s/\\ /g') sub(/[)].*/, "", u)
print n; print u
}'
)
IFS='|' read -ra snap <<< "$snap" IFS='|' read -ra snap <<< "$snap"
for item in "${snap[@]}" for item in "${snap[@]}"
@@ -320,14 +323,10 @@ _VBoxManage() {
_list_comp() { _list_comp() {
local list local list
list=$(VBoxManage list | \ list=$(VBoxManage list | sed -e '1,2d' \
grep '|' | \ -e 's/VBoxManage list //' \
sed 's/\[.*\]//g'| \ -e 's/[\[\]\|]/ /g' \
sed 's/VBoxManage list//' | \ -e 's/|/ /g'|xargs echo)
tr "\\n" " " | \
sed 's/$/\n/' | \
sed 's/\s\+//g' | \
sed 's/|/ /g')
COMPREPLY=( $(compgen -W "$list" -- ${cur}) ) COMPREPLY=( $(compgen -W "$list" -- ${cur}) )
} }
@@ -453,9 +452,9 @@ _VBoxManage() {
sort | \ sort | \
uniq) uniq)
# add debugvm command manually, since it's described differently in # Add some commands manually, since they are listed differently in
# vboxmanage help # vboxmanage help.
opts="${opts} debugvm unattended" opts="${opts} mediumio debugvm unattended extpack"
if [[ ${cur} == "-q" || ${COMP_CWORD} -eq 1 ]] ; then if [[ ${cur} == "-q" || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
@@ -580,7 +579,7 @@ _VBoxManage() {
;; ;;
--options) --options)
COMPREPLY=( $(compgen -W "link keepallmacs keepnatmacs COMPREPLY=( $(compgen -W "link keepallmacs keepnatmacs
keepdisknames" -- ${cur}) ) keepdisknames keephwuuids" -- ${cur}) )
;; ;;
--groups) --groups)
COMPREPLY=() COMPREPLY=()
@@ -638,18 +637,17 @@ _VBoxManage() {
setlinkstate3 setlinkstate4 setlinkstate5 setlinkstate6 setlinkstate3 setlinkstate4 setlinkstate5 setlinkstate6
setlinkstate7 setlinkstate8 setvideomodehint teleport unplugcpu setlinkstate7 setlinkstate8 setvideomodehint teleport unplugcpu
usbattach usbdetach vrde vrdeport vrdeproperty usbattach usbdetach vrde vrdeport vrdeproperty
vrdevideochannelquality webcam videocap videocapscreens vrdevideochannelquality webcam recording addencpassword
videocapfile videocapres videocaprate videocapfps removeencpassword removeallencpasswords keyboardputstring
videocapmaxtime videocapmaxsize addencpassword removeencpassword keyboardputfile audioin audioout setscreenlayout changeuartmode1
removeallencpasswords keyboardputstring keyboardputfile audioin changeuartmode2)
audioout)
_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
videocapfile|keyboardputfile|nictracefile[1-8]) keyboardputfile|nictracefile[1-8])
[[ ${prev} == "nictracefile"* ]] && \ [[ ${prev} == "nictracefile"* ]] && \
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
@@ -683,14 +681,28 @@ _VBoxManage() {
;; ;;
draganddrop) draganddrop)
[[ ${prev} == "draganddrop" ]] && \ [[ ${prev} == "draganddrop" ]] && \
COMPREPLY=( $(compgen -W "disabled COMPREPLY=( $(compgen -W "disabled hosttoguest
hosttoguest" -- ${cur}) ) guesttohost bidirectional" -- ${cur}) )
;; ;;
vrde|videocap) vrde)
[[ ${prev} == "vrde" || [[ ${prev} == "vrde" ]] && \
${prev} == "videocap" ]] && \
COMPREPLY=( $(compgen -W "on off" -- ${cur}) ) COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;; ;;
recording)
[[ ${prev} == "recording" ]] && \
COMPREPLY=( $(compgen -W "on off screens
filename videores videorate videofps maxtime
maxfilesize" -- ${cur}) )
case "${prev}" in
screens)
COMPREPLY=( $(compgen -W "all none
<screen>" -- ${cur}) )
;;
filename)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
esac
;;
videocapscreens) videocapscreens)
[[ ${prev} == "videocapscreens" ]] && \ [[ ${prev} == "videocapscreens" ]] && \
COMPREPLY=( $(compgen -W "all none" -- ${cur}) ) COMPREPLY=( $(compgen -W "all none" -- ${cur}) )
@@ -729,6 +741,12 @@ _VBoxManage() {
_get_excluded_items "${tmp[@]}" _get_excluded_items "${tmp[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
changeuartmode[1-2])
tmp=(disconnected server client tcpserver tcpclient
file "<devicename>")
_get_excluded_items "${tmp[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;;
esac esac
elif [[ ${prev} == "--passwordfile" || ${prev} == "--capturefile" ]]; then elif [[ ${prev} == "--passwordfile" || ${prev} == "--capturefile" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
@@ -789,7 +807,7 @@ _VBoxManage() {
;; ;;
--variant) --variant)
COMPREPLY=( $(compgen -W "Standard Fixed Split2G COMPREPLY=( $(compgen -W "Standard Fixed Split2G
Stream ESX" -- ${cur}) ) Stream ESX Formatted" -- ${cur}) )
;; ;;
esac esac
;; ;;
@@ -798,7 +816,8 @@ _VBoxManage() {
;; ;;
createvm) createvm)
items=(--name --groups --ostype --register --basefolder --uuid) items=(--name --groups --ostype --register --basefolder --uuid
--default)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
else else
@@ -884,7 +903,7 @@ _VBoxManage() {
if [[ " ${items[@]} " == *" $subcommand "* ]]; then if [[ " ${items[@]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
add|modify) add|modify)
items=(--ip --netmask --lowerip --upperip) items=(--ip --netmask --lowerip --upperip --options)
[[ " ${COMP_WORDS[@]} " != *" --ifname"* && [[ " ${COMP_WORDS[@]} " != *" --ifname"* &&
" ${COMP_WORDS[@]} " != *" --netname"* ]] && " ${COMP_WORDS[@]} " != *" --netname"* ]] &&
@@ -894,6 +913,9 @@ _VBoxManage() {
" ${COMP_WORDS[@]} " != *" --disable"* ]] && " ${COMP_WORDS[@]} " != *" --disable"* ]] &&
items+=(--enable --disable) items+=(--enable --disable)
[[ " ${COMP_WORDS[@]} " == *" --options"* ]] &&
items+=(--vm --nic --id --value --remove)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
@@ -942,11 +964,15 @@ _VBoxManage() {
;; ;;
"export") "export")
items=( --manifest --iso --options --vsys) items=( --manifest --iso --options --vsys --cloud)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
elif [[ ${prev} == "--eulafile" ]]; then elif [[ ${prev} == "--eulafile" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
elif [[ ${prev} == "--cloudkeepobject" ||
${prev} == "--cloudlaunchinstance" ||
${prev} == "--cloudpublicip" ]]; then
COMPREPLY=( $(compgen -W "true false" -- ${cur}) )
else else
[[ " ${COMP_WORDS[@]} " != *" -o "* && [[ " ${COMP_WORDS[@]} " != *" -o "* &&
" ${COMP_WORDS[@]} " != *" --output "* ]] && " ${COMP_WORDS[@]} " != *" --output "* ]] &&
@@ -959,7 +985,11 @@ _VBoxManage() {
items+=(--legacy09 --ovf09 --ovf10 --ovf20 --opc10) items+=(--legacy09 --ovf09 --ovf10 --ovf20 --opc10)
[[ " ${COMP_WORDS[@]} " == *" --vsys "* ]] && [[ " ${COMP_WORDS[@]} " == *" --vsys "* ]] &&
items+=(--product --producturl --vendor --vendorurl items+=(--product --producturl --vendor --vendorurl
--version --description --eula --eulafile) --version --description --eula --eulafile --vmname)
[[ " ${COMP_WORDS[@]} " == *" --cloud"* ]] &&
items+=(--vmname --cloudprofile --cloudshape --clouddomain
--clouddisksize --cloudbucket --cloudocivcn --cloudocisubnet
--cloudkeepobject --cloudlaunchinstance --cloudpublicip)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
@@ -968,6 +998,7 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "manifest iso nomacs COMPREPLY=( $(compgen -W "manifest iso nomacs
nomacsbutnat" -- ${cur}) ) nomacsbutnat" -- ${cur}) )
;; ;;
esac esac
[[ ${#COMPREPLY[@]} -eq 0 ]] && \ [[ ${#COMPREPLY[@]} -eq 0 ]] && \
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
@@ -1029,8 +1060,8 @@ _VBoxManage() {
--ignore-operhaned-processes --profile --ignore-operhaned-processes --profile
--dos2unix --unix2dos --username --domain --) --dos2unix --unix2dos --username --domain --)
[[ " ${comp_words[@]} " != *" --password "* || [[ " ${COMP_WORDS[@]} " != *" --password "* ||
" ${comp_words[@]} " != *" --passwordfile "* ]] && " ${COMP_WORDS[@]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --putenv "* && [[ " ${COMP_WORDS[@]} " != *" --putenv "* &&
" ${COMP_WORDS[@]} " != *" -E "* ]] && " ${COMP_WORDS[@]} " != *" -E "* ]] &&
@@ -1057,8 +1088,8 @@ _VBoxManage() {
--ignore-operhaned-processes --profile --ignore-operhaned-processes --profile
--username --domain --passwordfile --password --) --username --domain --passwordfile --password --)
[[ " ${comp_words[@]} " != *" --password "* || [[ " ${COMP_WORDS[@]} " != *" --password "* ||
" ${comp_words[@]} " != *" --passwordfile "* ]] && " ${COMP_WORDS[@]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* && [[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] && " ${COMP_WORDS[@]} " != *" -v "* ]] &&
@@ -1072,14 +1103,14 @@ _VBoxManage() {
;; ;;
copyfrom|copyto) copyfrom|copyto)
items=(--dryrun --follow --target-directory items=(--follow --target-directory --username
--username --domain) --domain)
[[ " ${COMP_WORDS[@]} " != *" --recursive "* && [[ " ${COMP_WORDS[@]} " != *" --recursive "* &&
" ${COMP_WORDS[@]} " != *" -R "* ]] && " ${COMP_WORDS[@]} " != *" -R "* ]] &&
items+=(--recursive -R) items+=(--recursive -R)
[[ " ${comp_words[@]} " != *" --password "* || [[ " ${COMP_WORDS[@]} " != *" --password "* ||
" ${comp_words[@]} " != *" --passwordfile "* ]] && " ${COMP_WORDS[@]} " != *" --passwordfile "* ]] &&
items+=(--passwordfile --password) items+=(--passwordfile --password)
[[ " ${COMP_WORDS[@]} " != *" --verbose "* && [[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
" ${COMP_WORDS[@]} " != *" -v "* ]] && " ${COMP_WORDS[@]} " != *" -v "* ]] &&
@@ -1435,6 +1466,31 @@ _VBoxManage() {
fi fi
;; ;;
mediumio)
if [[ ${prev} == ${cmd} ]]; then
_hdd_comp
_floppy_comp
_dvds_comp
else
case "${prev}" in
formatfat)
COMPREPLY=( $(compgen -W "--quick" -- ${cur}) )
;;
cat)
COMPREPLY=( $(compgen -W "--hex --offset --size
--output" -- ${cur}) )
;;
stream)
COMPREPLY=( $(compgen -W "--forma --variant
--output" -- ${cur}) )
;;
*)
COMPREPLY=( $(compgen -W "--password-file cat formatfat
stream" -- ${cur}) )
esac
fi
;;
mediumproperty) mediumproperty)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "disk dvd floppy" -- ${cur}) ) COMPREPLY=( $(compgen -W "disk dvd floppy" -- ${cur}) )
@@ -1522,7 +1578,7 @@ _VBoxManage() {
*) *)
_find_item_name 2 _find_item_name 2
items=(--type --autoreset --property --compact --resize items=(--type --autoreset --property --compact --resize
--move --description) --move --description --setlocation)
_get_excluded_items "${items[@]}" _get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in case "${prev}" in
@@ -1537,6 +1593,9 @@ _VBoxManage() {
--move) --move)
COMPREPLY=( $(compgen -o dirnames -- ${cur}) ) COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
;; ;;
--setlocation)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
esac esac
;; ;;
esac esac
@@ -1607,18 +1666,19 @@ _VBoxManage() {
--audiocontroller --clipboard --draganddrop --vrde --vrdeextpack --audiocontroller --clipboard --draganddrop --vrde --vrdeextpack
--vrdeproperty --vrdeport --vrdeaddress --vrdeauthtype --vrdeproperty --vrdeport --vrdeaddress --vrdeauthtype
--vrdeauthlibrary --vrdemulticon --vrdereusecon --vrdevideochannel --vrdeauthlibrary --vrdemulticon --vrdereusecon --vrdevideochannel
--vrdevideochannelquality --usb --usbehci --snapshotfolder --vrdevideochannelquality --usbohci --usbehci --snapshotfolder
--teleporter --teleporterport --teleporteraddress --teleporter --teleporterport --teleporteraddress
--teleporterpassword --teleporterpasswordfile --tracing-enabled --teleporterpassword --teleporterpasswordfile --tracing-enabled
--tracing-config --tracing-allow-vm-access --usbcardreader --tracing-config --tracing-allow-vm-access --usbcardreader
--autostart-enabled --autostart-delay --videocap --videocapscreens --autostart-enabled --autostart-delay --recording --recordingscreens
--videocapfile --videocapres --videocaprate --videocapfps --recordingfile --recordingvideores --recordingvideorate
--videocapmaxtime --videocapmaxsize --videocapopts --defaultfrontend --recordingvideofps --recordingmaxtime --recordingmaxsize
--cpuid-portability-level --paravirtprovider --audiocodec --usbxhci --recordingopts --defaultfrontend --cpuid-portability-level
--usbrename --apic --x2apic --paravirtdebug --cpu-profile --paravirtprovider --audiocodec --usbxhci --usbrename --apic
--biosapic --videocapopts --ibpb-on-vm-entry --ibpb-on-vm-exit --x2apic --paravirtdebug --cpu-profile --biosapic --ibpb-on-vm-entry
--spec-ctrl --audioin --audioout --l1d-flush-on-sched --ibpb-on-vm-exit --spec-ctrl --audioin --audioout
--l1d-flush-on-vm-entry) --l1d-flush-on-sched --l1d-flush-on-vm-entry --mds-clear-on-sched
--mds-clear-on-vm-entry --nested-hw-virt --uarttype1 --uarttype2)
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms _vms_comp vms
@@ -1654,17 +1714,19 @@ _VBoxManage() {
--natdnshostresolver3|--natdnshostresolver4|\ --natdnshostresolver3|--natdnshostresolver4|\
--natdnshostresolver5|--natdnshostresolver6|\ --natdnshostresolver5|--natdnshostresolver6|\
--natdnshostresolver7|--natdnshostresolver8|--vrde|\ --natdnshostresolver7|--natdnshostresolver8|--vrde|\
--vrdemulticon|--vrdereusecon|--vrdevideochannel|--usb|\ --vrdemulticon|--vrdereusecon|--vrdevideochannel|--usbohci|\
--usbehci|--teleporter|--tracing-enabled|\ --usbehci|--teleporter|--tracing-enabled|\
--tracing-allow-vm-access|--usbcardreader|\ --tracing-allow-vm-access|--usbcardreader|\
--autostart-enabled|--videocap|--usbxhci|--apic|--x2apic|\ --autostart-enabled|--recording|--usbxhci|--apic|--x2apic|\
--ibpb-on-vm-entry|--ibpb-on-vm-exit|--spec-ctrl|--audioin|\ --ibpb-on-vm-entry|--ibpb-on-vm-exit|--spec-ctrl|--audioin|\
--audioout|--l1d-flush-on-sched|--l1d-flush-on-vm-entry) --audioout|--l1d-flush-on-sched|--l1d-flush-on-vm-entry|\
--mds-clear-on-sched|--mds-clear-on-vm-entry|\
--nested-hw-virt)
COMPREPLY=( $(compgen -W "on off" -- ${cur}) ) COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;; ;;
--graphicscontroller) --graphicscontroller)
COMPREPLY=( $(compgen -W "none vboxvga vmsvga" \ COMPREPLY=( $(compgen -W "none vboxvga vmsvga vboxsvga" \
-- ${cur}) ) -- ${cur}) )
;; ;;
@@ -1739,66 +1801,71 @@ _VBoxManage() {
;; ;;
--natpf[1-8]) --natpf[1-8])
COMPREPLY+=( $(compgen -W "delete" -- ${cur}) ) COMPREPLY=( $(compgen -W "delete" -- ${cur}) )
;; ;;
--nataliasmode[1-8]) --nataliasmode[1-8])
COMPREPLY+=( $(compgen -W "default" -- ${cur}) ) COMPREPLY=( $(compgen -W "default" -- ${cur}) )
;; ;;
--macaddress[1-8]) --macaddress[1-8])
COMPREPLY+=( $(compgen -W "auto" -- ${cur}) ) COMPREPLY=( $(compgen -W "auto" -- ${cur}) )
;; ;;
--mouse) --mouse)
COMPREPLY+=( $(compgen -W "ps2 usb usbtablet COMPREPLY=( $(compgen -W "ps2 usb usbtablet
usbmultitouch" -- ${cur}) ) usbmultitouch" -- ${cur}) )
;; ;;
--keyboard) --keyboard)
COMPREPLY+=( $(compgen -W "ps2 usb" -- ${cur}) ) COMPREPLY=( $(compgen -W "ps2 usb" -- ${cur}) )
;; ;;
--uart[1-2]|--lpt[1-2]) --uart[1-2]|--lpt[1-2])
COMPREPLY+=( $(compgen -W "off" -- ${cur}) ) COMPREPLY=( $(compgen -W "off" -- ${cur}) )
;; ;;
--uartmode[1-2]) --uartmode[1-2])
COMPREPLY+=( $(compgen -W "disconnected server client COMPREPLY=( $(compgen -W "disconnected server client
tcpserver tcpclient file" -- ${cur}) ) tcpserver tcpclient file" -- ${cur}) )
;; ;;
--uarttype[1-2])
COMPREPLY=( $(compgen -W "16450 16550A
16750" -- ${cur}) )
;;
--audio) --audio)
COMPREPLY+=( $(compgen -W "none null oss alsa pulse" \ COMPREPLY=( $(compgen -W "none null oss alsa pulse" \
-- ${cur}) ) -- ${cur}) )
;; ;;
--audiocontroller) --audiocontroller)
COMPREPLY+=( $(compgen -W "ac97 hda sb16" -- ${cur}) ) COMPREPLY=( $(compgen -W "ac97 hda sb16" -- ${cur}) )
;; ;;
--audiocodec) --audiocodec)
COMPREPLY+=( $(compgen -W "stac9700 ad1980 stac9221 COMPREPLY=( $(compgen -W "stac9700 ad1980 stac9221
sb16" -- ${cur}) ) sb16" -- ${cur}) )
;; ;;
--clipboard) --clipboard)
COMPREPLY+=( $(compgen -W "disabled hosttoguest COMPREPLY=( $(compgen -W "disabled hosttoguest
guesttohost bidirectional" -- ${cur}) ) guesttohost bidirectional" -- ${cur}) )
;; ;;
--draganddrop) --draganddrop)
COMPREPLY+=( $(compgen -W "disabled hosttoguest" \ COMPREPLY=( $(compgen -W "disabled hosttoguest
-- ${cur}) ) guesttohost bidirectional" -- ${cur}) )
;; ;;
--vrdeextpack|--vrdeauthlibrary|--snapshotfolder|\ --vrdeextpack|--vrdeauthlibrary|--snapshotfolder|\
--defaultfrontend) --defaultfrontend)
COMPREPLY+=( $(compgen -W "default" -- ${cur}) ) COMPREPLY=( $(compgen -W "default" -- ${cur}) )
;; ;;
--vrdeauthtype) --vrdeauthtype)
COMPREPLY+=( $(compgen -W "null external guest" \ COMPREPLY=( $(compgen -W "null external guest" \
-- ${cur}) ) -- ${cur}) )
;; ;;
@@ -1820,7 +1887,7 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "disabled apic x2apic" \ COMPREPLY=( $(compgen -W "disabled apic x2apic" \
-- ${cur}) ) -- ${cur}) )
;; ;;
--teleporterpasswordfile|--iconfile|--videocapfile) --teleporterpasswordfile|--iconfile|--recordingfile)
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
;; ;;
--nictracefile[1-8]) --nictracefile[1-8])
@@ -1833,6 +1900,26 @@ _VBoxManage() {
fi fi
;; ;;
movevm)
if [[ ${prev} == ${cmd} ]]; then
_vms_comp vms
else
_find_item_name 2
items=(--type --folder)
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in
--type)
COMPREPLY=( $(compgen -W "basic" -- ${cur}) )
_snapshot_comp
;;
--folder)
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
esac
fi
;;
natnetwork) natnetwork)
items=(add remove modify start stop list) items=(add remove modify start stop list)
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
@@ -1885,7 +1972,7 @@ _VBoxManage() {
setproperty) setproperty)
items=(machinefolder hwvirtexclusive vrdeauthlibrary items=(machinefolder hwvirtexclusive vrdeauthlibrary
websrvauthlibrary vrdeextpack autostartdbpath loghistorycount websrvauthlibrary vrdeextpack autostartdbpath loghistorycount
defaultfrontend logginglevel) defaultfrontend logginglevel proxymode proxyurl)
subcommand=${COMP_WORDS[2]} subcommand=${COMP_WORDS[2]}
if [[ "${prev}" == "${cmd}" ]]; then if [[ "${prev}" == "${cmd}" ]]; then
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
@@ -1912,6 +1999,10 @@ _VBoxManage() {
defaultfrontend) defaultfrontend)
COMPREPLY=( $(compgen -W "null" -- ${cur}) ) COMPREPLY=( $(compgen -W "null" -- ${cur}) )
;; ;;
proxymode)
COMPREPLY=( $(compgen -W "system noproxy
manual" -- ${cur}) )
;;
esac esac
fi fi
;; ;;