mirror of
https://github.com/gryf/vboxmanage-bash-completion.git
synced 2025-12-19 12:28:19 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c5b048c62 | |||
| 5fd18d7cec | |||
| 05af06f337 | |||
| cde78c8e4c | |||
|
|
197c46cd35 | ||
|
|
296be19560 | ||
| 62f57ebbb7 | |||
| d4f56a0d6b | |||
| f8b5981935 | |||
| d027094e7c | |||
| e90270e8ee | |||
| 11a0844c4d | |||
| 9b06c430fd | |||
| fbdd259cac | |||
| d79a8bc280 | |||
| 20b1ef9fab | |||
| 1674acbe92 | |||
| 9b7ab10421 | |||
| 47e3ff6bbe | |||
| f81bfe514f | |||
| a78a03286a |
@@ -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.0.40, and supports all commands (in some extent ;)).
|
5.2.26, and supports all commands (in some extent ;)).
|
||||||
|
|
||||||
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:
|
||||||
|
|||||||
270
VBoxManage
270
VBoxManage
@@ -4,6 +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.26
|
||||||
|
|
||||||
_VBoxManage() {
|
_VBoxManage() {
|
||||||
local cur prev opts cmd subcommand tmp items name index result
|
local cur prev opts cmd subcommand tmp items name index result
|
||||||
@@ -41,6 +42,18 @@ _VBoxManage() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_is_any_item_used() {
|
||||||
|
local i
|
||||||
|
|
||||||
|
result=""
|
||||||
|
for i in $@; do
|
||||||
|
if [[ " ${COMP_WORDS[@]} " == *" $i "* ]]; then
|
||||||
|
result="ITIS"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# Generate registered hard disk files.
|
# Generate registered hard disk files.
|
||||||
# NOTE: This function may introduce some quirks, if there is a space or
|
# NOTE: This function may introduce some quirks, if there is a space or
|
||||||
# other characters which usually are treated as IFS - like space. Pipe
|
# other characters which usually are treated as IFS - like space. Pipe
|
||||||
@@ -258,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[@]}"
|
||||||
@@ -440,6 +456,10 @@ _VBoxManage() {
|
|||||||
sort | \
|
sort | \
|
||||||
uniq)
|
uniq)
|
||||||
|
|
||||||
|
# add debugvm command manually, since it's described differently in
|
||||||
|
# vboxmanage help
|
||||||
|
opts="${opts} debugvm unattended"
|
||||||
|
|
||||||
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}) )
|
||||||
return 0
|
return 0
|
||||||
@@ -499,6 +519,7 @@ _VBoxManage() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
checkmediumpwd)
|
checkmediumpwd)
|
||||||
if [[ ${prev} == ${cmd} ]]; then
|
if [[ ${prev} == ${cmd} ]]; then
|
||||||
_hdd_comp
|
_hdd_comp
|
||||||
@@ -623,15 +644,15 @@ _VBoxManage() {
|
|||||||
vrdevideochannelquality webcam videocap videocapscreens
|
vrdevideochannelquality webcam videocap videocapscreens
|
||||||
videocapfile videocapres videocaprate videocapfps
|
videocapfile videocapres videocaprate videocapfps
|
||||||
videocapmaxtime videocapmaxsize addencpassword removeencpassword
|
videocapmaxtime videocapmaxsize addencpassword removeencpassword
|
||||||
removeallencpasswords)
|
removeallencpasswords keyboardputstring keyboardputfile audioin
|
||||||
|
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
|
||||||
nictracefile[1-8])
|
videocapfile|keyboardputfile|nictracefile[1-8])
|
||||||
[[ ${prev} == "nictracefile"* ]] && \
|
[[ ${prev} == "nictracefile"* ]] && \
|
||||||
COMPREPLY=( $(compgen -f -- ${cur}) )
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
@@ -654,7 +675,7 @@ _VBoxManage() {
|
|||||||
COMPREPLY=( $(compgen -W "delete tcp
|
COMPREPLY=( $(compgen -W "delete tcp
|
||||||
udp" -- ${cur}) )
|
udp" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
setlinkstate[1-8])
|
audioin|audioout|setlinkstate[1-8])
|
||||||
[[ ${prev} == "setlinkstate"* ]] && \
|
[[ ${prev} == "setlinkstate"* ]] && \
|
||||||
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
@@ -665,8 +686,8 @@ _VBoxManage() {
|
|||||||
;;
|
;;
|
||||||
draganddrop)
|
draganddrop)
|
||||||
[[ ${prev} == "draganddrop" ]] && \
|
[[ ${prev} == "draganddrop" ]] && \
|
||||||
COMPREPLY=( $(compgen -W "disabled
|
COMPREPLY=( $(compgen -W "disabled hosttoguest
|
||||||
hosttoguest" -- ${cur}) )
|
guesttohost bidirectional" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
vrde|videocap)
|
vrde|videocap)
|
||||||
[[ ${prev} == "vrde" ||
|
[[ ${prev} == "vrde" ||
|
||||||
@@ -702,11 +723,9 @@ _VBoxManage() {
|
|||||||
_get_excluded_items "${tmp[@]}"
|
_get_excluded_items "${tmp[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--removeonsuspend)
|
--removeonsuspend)
|
||||||
COMPREPLY=( $(compgen -W "yes no" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "yes no" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
addencpassword)
|
addencpassword)
|
||||||
tmp=(--host --port --maxdowntime --passwordfile
|
tmp=(--host --port --maxdowntime --passwordfile
|
||||||
--password)
|
--password)
|
||||||
@@ -714,6 +733,8 @@ _VBoxManage() {
|
|||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
elif [[ ${prev} == "--passwordfile" || ${prev} == "--capturefile" ]]; then
|
||||||
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
else
|
else
|
||||||
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
||||||
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
||||||
@@ -759,7 +780,7 @@ _VBoxManage() {
|
|||||||
|
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
--filename)
|
--filename)
|
||||||
COMPREPLY=( $(compgen -- ${cur}) )
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
--diffparent)
|
--diffparent)
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
@@ -807,9 +828,9 @@ _VBoxManage() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
debugvm)
|
"debugvm")
|
||||||
items=(dumpguestcore info injectnmi log logdest logflags osdetect
|
items=(dumpguestcore info injectnmi log logdest logflags osdetect
|
||||||
osinfo osdmesg getregisters setregisters show statistics)
|
osinfo osdmesg getregisters setregisters show statistics stack)
|
||||||
if [[ ${prev} == ${cmd} ]]; then
|
if [[ ${prev} == ${cmd} ]]; then
|
||||||
_vms_comp runningvms
|
_vms_comp runningvms
|
||||||
else
|
else
|
||||||
@@ -826,7 +847,7 @@ _VBoxManage() {
|
|||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
getregisters|setregisters)
|
getregisters|setregisters|stack)
|
||||||
_get_excluded_items "--cpu"
|
_get_excluded_items "--cpu"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
@@ -837,7 +858,7 @@ _VBoxManage() {
|
|||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
statistics)
|
statistics)
|
||||||
items=(--reset --pattern)
|
items=(--reset --pattern --descriptions)
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
@@ -850,11 +871,10 @@ _VBoxManage() {
|
|||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
_get_excluded_items "--descriptions"
|
|
||||||
COMPREPLY+=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY+=( $(compgen -W "$result" -- ${cur}) )
|
||||||
else
|
else
|
||||||
[[ "${prev}" == "--filename" ]] && \
|
[[ "${prev}" == "--filename" ]] && \
|
||||||
COMPREPLY=( $(compgen -- ${cur}) )
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
||||||
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
@@ -921,7 +941,6 @@ _VBoxManage() {
|
|||||||
else
|
else
|
||||||
COMPREPLY=( $(compgen -W "--newpassword --oldpassword --cipher
|
COMPREPLY=( $(compgen -W "--newpassword --oldpassword --cipher
|
||||||
--newpasswordid" -- ${cur}) )
|
--newpasswordid" -- ${cur}) )
|
||||||
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -929,6 +948,8 @@ _VBoxManage() {
|
|||||||
items=( --manifest --iso --options --vsys)
|
items=( --manifest --iso --options --vsys)
|
||||||
if [[ ${prev} == ${cmd} ]]; then
|
if [[ ${prev} == ${cmd} ]]; then
|
||||||
_vms_comp vms
|
_vms_comp vms
|
||||||
|
elif [[ ${prev} == "--eulafile" ]]; then
|
||||||
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
else
|
else
|
||||||
[[ " ${COMP_WORDS[@]} " != *" -o "* &&
|
[[ " ${COMP_WORDS[@]} " != *" -o "* &&
|
||||||
" ${COMP_WORDS[@]} " != *" --output "* ]] &&
|
" ${COMP_WORDS[@]} " != *" --output "* ]] &&
|
||||||
@@ -936,8 +957,9 @@ _VBoxManage() {
|
|||||||
[[ " ${COMP_WORDS[@]} " != *" --legacy09 "* &&
|
[[ " ${COMP_WORDS[@]} " != *" --legacy09 "* &&
|
||||||
" ${COMP_WORDS[@]} " != *" --ovf09 "* &&
|
" ${COMP_WORDS[@]} " != *" --ovf09 "* &&
|
||||||
" ${COMP_WORDS[@]} " != *" --ovf10 "* &&
|
" ${COMP_WORDS[@]} " != *" --ovf10 "* &&
|
||||||
" ${COMP_WORDS[@]} " != *" --ovf20 "* ]] &&
|
" ${COMP_WORDS[@]} " != *" --ovf20 "* &&
|
||||||
items+=(--legacy09 --ovf09 --ovf10 --ovf20)
|
" ${COMP_WORDS[@]} " != *" --opc20 "* ]] &&
|
||||||
|
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)
|
||||||
@@ -1007,11 +1029,11 @@ _VBoxManage() {
|
|||||||
case "${subcommand}" in
|
case "${subcommand}" in
|
||||||
run)
|
run)
|
||||||
items=(--exe --timeout --unquoted-args
|
items=(--exe --timeout --unquoted-args
|
||||||
--ignore-operhaned-processes --no-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 "* ]] &&
|
||||||
@@ -1035,11 +1057,11 @@ _VBoxManage() {
|
|||||||
|
|
||||||
start)
|
start)
|
||||||
items=(--exe --timeout --unquoted-args
|
items=(--exe --timeout --unquoted-args
|
||||||
--ignore-operhaned-processes --no-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 "* ]] &&
|
||||||
@@ -1059,8 +1081,8 @@ _VBoxManage() {
|
|||||||
[[ " ${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 "* ]] &&
|
||||||
@@ -1246,6 +1268,7 @@ _VBoxManage() {
|
|||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
updatega|updateguestadditions|updateadditions)
|
updatega|updateguestadditions|updateadditions)
|
||||||
items=(--source --wait-start)
|
items=(--source --wait-start)
|
||||||
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
|
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
|
||||||
@@ -1258,6 +1281,7 @@ _VBoxManage() {
|
|||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
watch)
|
watch)
|
||||||
items=()
|
items=()
|
||||||
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
|
[[ " ${COMP_WORDS[@]} " != *" --verbose "* &&
|
||||||
@@ -1271,6 +1295,7 @@ _VBoxManage() {
|
|||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
close)
|
close)
|
||||||
items=(--verbose)
|
items=(--verbose)
|
||||||
@@ -1284,7 +1309,7 @@ _VBoxManage() {
|
|||||||
--image)
|
--image)
|
||||||
COMPREPLY=( $(compgen -- ${cur}) )
|
COMPREPLY=( $(compgen -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
--tmpdir)
|
--target-directory|--tmpdir)
|
||||||
COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
|
COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
--source)
|
--source)
|
||||||
@@ -1295,6 +1320,9 @@ _VBoxManage() {
|
|||||||
"${COMPREPLY[0]}" != *".iso" ]] && \
|
"${COMPREPLY[0]}" != *".iso" ]] && \
|
||||||
COMPREPLY[0]="${COMPREPLY[0]}/"
|
COMPREPLY[0]="${COMPREPLY[0]}/"
|
||||||
;;
|
;;
|
||||||
|
--passwordfile)
|
||||||
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
||||||
@@ -1397,11 +1425,14 @@ _VBoxManage() {
|
|||||||
_list_comp ${cur}
|
_list_comp ${cur}
|
||||||
else
|
else
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
|
--sorted|-s)
|
||||||
|
COMPREPLY=( $(compgen -W "-l --long" -- ${cur}) )
|
||||||
|
;;
|
||||||
--long|-l)
|
--long|-l)
|
||||||
COMPREPLY=()
|
COMPREPLY=( $(compgen -W "-s --sorted" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
COMPREPLY=( $(compgen -W "-l --long" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "-l --long -s --sorted" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@@ -1469,14 +1500,12 @@ _VBoxManage() {
|
|||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
||||||
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
modifymedium)
|
modifymedium)
|
||||||
@@ -1495,7 +1524,8 @@ _VBoxManage() {
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_find_item_name 2
|
_find_item_name 2
|
||||||
items=(--type --autoreset --property --compact --resize)
|
items=(--type --autoreset --property --compact --resize
|
||||||
|
--move --description)
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
@@ -1507,6 +1537,9 @@ _VBoxManage() {
|
|||||||
--autoreset)
|
--autoreset)
|
||||||
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
--move)
|
||||||
|
COMPREPLY=( $(compgen -o dirnames -- ${cur}) )
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1517,7 +1550,7 @@ _VBoxManage() {
|
|||||||
items=(--name --groups --description --ostype --iconfile --memory
|
items=(--name --groups --description --ostype --iconfile --memory
|
||||||
--pagefusion --vram --acpi --pciattach --pcidetach --ioapic --hpet
|
--pagefusion --vram --acpi --pciattach --pcidetach --ioapic --hpet
|
||||||
--triplefaultreset --hwvirtex --nestedpaging --largepages --vtxvpid
|
--triplefaultreset --hwvirtex --nestedpaging --largepages --vtxvpid
|
||||||
--vtxux --pae --longmode --cpuidset --cpuidremove
|
--vtxux --pae --longmode --cpuid-set --cpuid-remove
|
||||||
--cpuidremoveall --hardwareuuid --cpus --cpuhotplug --plugcpu
|
--cpuidremoveall --hardwareuuid --cpus --cpuhotplug --plugcpu
|
||||||
--unplugcpu --cpuexecutioncap --rtcuseutc --graphicscontroller
|
--unplugcpu --cpuexecutioncap --rtcuseutc --graphicscontroller
|
||||||
--monitorcount --accelerate3d --accelerate2dvideo --firmware
|
--monitorcount --accelerate3d --accelerate2dvideo --firmware
|
||||||
@@ -1585,7 +1618,10 @@ _VBoxManage() {
|
|||||||
--videocapfile --videocapres --videocaprate --videocapfps
|
--videocapfile --videocapres --videocaprate --videocapfps
|
||||||
--videocapmaxtime --videocapmaxsize --videocapopts --defaultfrontend
|
--videocapmaxtime --videocapmaxsize --videocapopts --defaultfrontend
|
||||||
--cpuid-portability-level --paravirtprovider --audiocodec --usbxhci
|
--cpuid-portability-level --paravirtprovider --audiocodec --usbxhci
|
||||||
--usbrename)
|
--usbrename --apic --x2apic --paravirtdebug --cpu-profile
|
||||||
|
--biosapic --ibpb-on-vm-entry --ibpb-on-vm-exit --spec-ctrl
|
||||||
|
--audioin --audioout --l1d-flush-on-sched
|
||||||
|
--l1d-flush-on-vm-entry)
|
||||||
|
|
||||||
if [[ ${prev} == ${cmd} ]]; then
|
if [[ ${prev} == ${cmd} ]]; then
|
||||||
_vms_comp vms
|
_vms_comp vms
|
||||||
@@ -1597,10 +1633,12 @@ _VBoxManage() {
|
|||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_group_comp
|
_group_comp
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--ostype)
|
--ostype)
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_os_comp
|
_os_comp
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--pagefusion|--acpi|--ioapic|--hpet|--triplefaultreset|\
|
--pagefusion|--acpi|--ioapic|--hpet|--triplefaultreset|\
|
||||||
--hwvirtex|--nestedpaging|--largepages|--vtxvpid|--vtxux|\
|
--hwvirtex|--nestedpaging|--largepages|--vtxvpid|--vtxux|\
|
||||||
--pae|--longmode|--cpuhotplug|--rtcuseutc|\
|
--pae|--longmode|--cpuhotplug|--rtcuseutc|\
|
||||||
@@ -1622,73 +1660,91 @@ _VBoxManage() {
|
|||||||
--vrdemulticon|--vrdereusecon|--vrdevideochannel|--usb|\
|
--vrdemulticon|--vrdereusecon|--vrdevideochannel|--usb|\
|
||||||
--usbehci|--teleporter|--tracing-enabled|\
|
--usbehci|--teleporter|--tracing-enabled|\
|
||||||
--tracing-allow-vm-access|--usbcardreader|\
|
--tracing-allow-vm-access|--usbcardreader|\
|
||||||
--autostart-enabled|--videocap|--usbxhci)
|
--autostart-enabled|--videocap|--usbxhci|--apic|--x2apic|\
|
||||||
|
--ibpb-on-vm-entry|--ibpb-on-vm-exit|--spec-ctrl|--audioin|\
|
||||||
|
--audioout|--l1d-flush-on-sched|--l1d-flush-on-vm-entry)
|
||||||
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" \
|
||||||
-- ${cur}) )
|
-- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--firmware)
|
--firmware)
|
||||||
COMPREPLY=( $(compgen -W "bios efi efi32 efi64" \
|
COMPREPLY=( $(compgen -W "bios efi efi32 efi64" \
|
||||||
-- ${cur}) )
|
-- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--chipset)
|
--chipset)
|
||||||
COMPREPLY=( $(compgen -W "ich9 piix3" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "ich9 piix3" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--biosbootmenu)
|
--biosbootmenu)
|
||||||
COMPREPLY=( $(compgen -W "disabled menuonly
|
COMPREPLY=( $(compgen -W "disabled menuonly
|
||||||
messageandmenu" -- ${cur}) )
|
messageandmenu" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--boot[1-4])
|
--boot[1-4])
|
||||||
COMPREPLY=( $(compgen -W "none floppy dvd disk net" \
|
COMPREPLY=( $(compgen -W "none floppy dvd disk net" \
|
||||||
-- ${cur}) )
|
-- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--nic[1-8])
|
--nic[1-8])
|
||||||
COMPREPLY=( $(compgen -W "none null nat bridged intnet
|
COMPREPLY=( $(compgen -W "none null nat bridged intnet
|
||||||
hostonly generic natnetwork" -- ${cur}) )
|
hostonly generic natnetwork" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--nictype[1-8])
|
--nictype[1-8])
|
||||||
COMPREPLY=( $(compgen -W "Am79C970A Am79C973 82540EM
|
COMPREPLY=( $(compgen -W "Am79C970A Am79C973 82540EM
|
||||||
82543GC 82545EM virtio" -- ${cur}) )
|
82543GC 82545EM virtio" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--nicpromisc[1-8])
|
--nicpromisc[1-8])
|
||||||
COMPREPLY=( $(compgen -W "deny allow-vms allow-all" \
|
COMPREPLY=( $(compgen -W "deny allow-vms allow-all" \
|
||||||
-- ${cur}) )
|
-- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--nicbandwidthgroup[1-8])
|
--nicbandwidthgroup[1-8])
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_bandwidthctl_comp
|
_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
|
_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
|
_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
|
_intnet_comp
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--nat-network[1-8])
|
--nat-network[1-8])
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_natnet_comp
|
_natnet_comp
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--natnet[1-8])
|
--natnet[1-8])
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_natnet_comp
|
_natnet_comp
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--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}) )
|
||||||
;;
|
;;
|
||||||
@@ -1696,10 +1752,12 @@ _VBoxManage() {
|
|||||||
--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}) )
|
||||||
;;
|
;;
|
||||||
@@ -1707,10 +1765,12 @@ _VBoxManage() {
|
|||||||
--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}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--audio)
|
--audio)
|
||||||
COMPREPLY+=( $(compgen -W "none null oss alsa pulse" \
|
COMPREPLY+=( $(compgen -W "none null oss alsa pulse" \
|
||||||
-- ${cur}) )
|
-- ${cur}) )
|
||||||
@@ -1729,32 +1789,55 @@ _VBoxManage() {
|
|||||||
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}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--paravirtprovider)
|
--paravirtprovider)
|
||||||
COMPREPLY=( $(compgen -W "none default legacy minimal
|
COMPREPLY=( $(compgen -W "none default legacy minimal
|
||||||
hyperv kvm" -- ${cur}) )
|
hyperv kvm" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--cpuid-portability-level)
|
--cpuid-portability-level)
|
||||||
COMPREPLY=( $(compgen -W "0 1 2 3" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "0 1 2 3" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
--cpu-profile)
|
||||||
|
COMPREPLY=( $(compgen -W "host 8086 80286 80386" \
|
||||||
|
-- ${cur}) )
|
||||||
|
;;
|
||||||
|
|
||||||
|
--biosapic)
|
||||||
|
COMPREPLY=( $(compgen -W "disabled apic x2apic" \
|
||||||
|
-- ${cur}) )
|
||||||
|
;;
|
||||||
|
--teleporterpasswordfile|--iconfile|--videocapfile)
|
||||||
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
|
;;
|
||||||
|
--nictracefile[1-8])
|
||||||
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
|
;;
|
||||||
|
--nattftpfile[1-8])
|
||||||
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
natnetwork)
|
natnetwork)
|
||||||
items=(add remove modify start stop)
|
items=(add remove modify start stop list)
|
||||||
subcommand=${COMP_WORDS[2]}
|
subcommand=${COMP_WORDS[2]}
|
||||||
if [[ "${prev}" == "--netname" ]]; then
|
if [[ "${prev}" == "--netname" ]]; then
|
||||||
_natnet_comp
|
_natnet_comp
|
||||||
@@ -1872,6 +1955,7 @@ _VBoxManage() {
|
|||||||
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
||||||
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
showmediuminfo)
|
showmediuminfo)
|
||||||
if [[ ${prev} == ${cmd} ]]; then
|
if [[ ${prev} == ${cmd} ]]; then
|
||||||
COMPREPLY=( $(compgen -W "disk dvd floppy" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "disk dvd floppy" -- ${cur}) )
|
||||||
@@ -1967,7 +2051,13 @@ _VBoxManage() {
|
|||||||
elif [[ "${prev}" == "--type" ]]; then
|
elif [[ "${prev}" == "--type" ]]; then
|
||||||
COMPREPLY=( $(compgen -W "gui sdl headless separate" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "gui sdl headless separate" -- ${cur}) )
|
||||||
else
|
else
|
||||||
|
local items=(--putenv -E)
|
||||||
|
_is_any_item_used "${items[@]}"
|
||||||
|
if [[ "${result}" == "ITIS" ]]; then
|
||||||
local items=(--type)
|
local items=(--type)
|
||||||
|
else
|
||||||
|
local items=(--type -E --putenv)
|
||||||
|
fi
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
@@ -1982,7 +2072,7 @@ _VBoxManage() {
|
|||||||
--comment --setuuid --setparentuuid --passthrough --tempeject
|
--comment --setuuid --setparentuuid --passthrough --tempeject
|
||||||
--nonrotational --discard --hotpluggable --bandwidthgroup
|
--nonrotational --discard --hotpluggable --bandwidthgroup
|
||||||
--forceunmount --server --target --tport --lun --encodedlun
|
--forceunmount --server --target --tport --lun --encodedlun
|
||||||
--username --password --initiator --intnet)
|
--username --password --initiator --intnet --passwordfile)
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
|
||||||
@@ -2008,6 +2098,9 @@ _VBoxManage() {
|
|||||||
--passthrough|--tempeject|--nonrotational|--discard)
|
--passthrough|--tempeject|--nonrotational|--discard)
|
||||||
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
|
--passwordfile)
|
||||||
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -2023,11 +2116,11 @@ _VBoxManage() {
|
|||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
--add)
|
--add)
|
||||||
COMPREPLY=( $(compgen -W "ide sata scsi floppy
|
COMPREPLY=( $(compgen -W "ide sata scsi floppy
|
||||||
sas" -- ${cur}) )
|
sas usb pcie" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
--controller)
|
--controller)
|
||||||
COMPREPLY=( $(compgen -W "LSILogic LSILogicSAS BusLogic
|
COMPREPLY=( $(compgen -W "LSILogic LSILogicSAS BusLogic
|
||||||
IntelAHCI PIIX3 PIIX4 ICH6 I82078" -- ${cur}) )
|
IntelAHCI PIIX3 PIIX4 ICH6 I82078 USB NVMe" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
--bootable|--hostiocache)
|
--bootable|--hostiocache)
|
||||||
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
|
||||||
@@ -2046,7 +2139,7 @@ _VBoxManage() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
usbfilte)
|
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
|
||||||
@@ -2087,6 +2180,89 @@ _VBoxManage() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
usbdevsource)
|
||||||
|
if [[ COMP_CWORD -ge 3 ]]; then
|
||||||
|
subcommand="${COMP_WORDS[2]}"
|
||||||
|
if [[ $subcommand == "${cmd}" ]]; then
|
||||||
|
subcommand="${COMP_WORDS[3]}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${prev} == ${cmd} ]]; then
|
||||||
|
COMPREPLY=( $(compgen -W "add remove" -- ${cur}) )
|
||||||
|
else
|
||||||
|
if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
|
||||||
|
case "${subcommand}" in
|
||||||
|
add)
|
||||||
|
local items=(--address --backend)
|
||||||
|
_get_excluded_items "${items[@]}"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
unattended)
|
||||||
|
if [[ COMP_CWORD -ge 3 ]]; then
|
||||||
|
subcommand="${COMP_WORDS[2]}"
|
||||||
|
if [[ $subcommand == "${cmd}" ]]; then
|
||||||
|
subcommand="${COMP_WORDS[3]}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${prev} == ${cmd} ]]; then
|
||||||
|
COMPREPLY=( $(compgen -W "detect install" -- ${cur}) )
|
||||||
|
else
|
||||||
|
case "${prev}" in
|
||||||
|
--iso|--password-file|--additions-iso|--validation-kit-iso|\
|
||||||
|
--script-template|--post-install-template)
|
||||||
|
COMPREPLY+=( $(compgen -f -- ${cur}) )
|
||||||
|
;;
|
||||||
|
--auxiliary-base-path)
|
||||||
|
COMPREPLY+=( $(compgen -o dirnames -- ${cur}) )
|
||||||
|
;;
|
||||||
|
--start-vm)
|
||||||
|
COMPREPLY=( $(compgen -W "gui sdl headless separate" \
|
||||||
|
-- ${cur}) )
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
|
||||||
|
case "${subcommand}" in
|
||||||
|
detect)
|
||||||
|
local items=(--iso --machine-readable)
|
||||||
|
_get_excluded_items "${items[@]}"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
;;
|
||||||
|
install)
|
||||||
|
if [[ ${prev} == ${subcommand} ]]; then
|
||||||
|
_vms_comp vms
|
||||||
|
else
|
||||||
|
local items=(--iso --user=login
|
||||||
|
--password=password --password-file
|
||||||
|
--full-user-name --key
|
||||||
|
--install-additions --no-install-additions
|
||||||
|
--additions-iso --install-txs --no-install-txs
|
||||||
|
--validation-kit-iso --locale --country
|
||||||
|
--time-zone --hostname
|
||||||
|
--package-selection-adjustment --dry-run
|
||||||
|
--auxiliary-base-path=path --image-index
|
||||||
|
--script-template --post-install-template
|
||||||
|
--post-install-command
|
||||||
|
--extra-install-kernel-parameters --language
|
||||||
|
--start-vm)
|
||||||
|
_get_excluded_items "${items[@]}"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
complete -o default -F _VBoxManage VBoxManage
|
complete -o default -F _VBoxManage VBoxManage
|
||||||
|
|||||||
Reference in New Issue
Block a user