Updated controlvm command

This commit is contained in:
2023-03-13 15:54:56 +01:00
parent 385c78df30
commit 12e85b78da

View File

@@ -816,30 +816,34 @@ _VBoxManage() {
if [[ ${prev} == ${cmd} ]]; then if [[ ${prev} == ${cmd} ]]; then
_vms_comp runningvms _vms_comp runningvms
else else
local items=(acpipowerbutton acpisleepbutton clipboard local items=( acpipowerbutton acpisleepbutton addencpassword
cpuexecutioncap draganddrop guestmemoryballoon audioin audioout autostart-delayseconds autostart-enabled1
keyboardputscancode natpf1 nic1 nicpromisc1 nicproperty1 autostart-enabled2 autostart-enabled3 autostart-enabled4
nictrace1 nictracefile1 natpf2 nic2 nicpromisc2 nicproperty2 changeuartmode1 changeuartmode2 clipboard cpuexecutioncap
nictrace2 nictracefile2 natpf3 nic3 nicpromisc3 nicproperty3 draganddrop guestmemoryballoon keyboardputfile
nictrace3 nictracefile3 natpf4 nic4 nicpromisc4 nicproperty4 keyboardputscancode keyboardputstring natpf1 natpf2 natpf3
nictrace4 nictracefile4 natpf5 nic5 nicpromisc5 nicproperty5 natpf4 natpf5 natpf6 natpf7 natpf8 natpf9 natpf1delete
nictrace5 nictracefile5 natpf6 nic6 nicpromisc6 nicproperty6 natpf2delete natpf3delete natpf4delete natpf5delete natpf6delete
nictrace6 nictracefile6 natpf7 nic7 nicpromisc7 nicproperty7 natpf7delete natpf8delete nic1 nic2 nic3 nic4 nic5 nic6 nic7
nictrace7 nictracefile7 natpf8 nic8 nicpromisc8 nicproperty8 nic8 nicpromisc1 nicpromisc2 nicpromisc3 nicpromisc4 nicpromisc5
nictrace8 pause plugcpu poweroff reset resume savestate nicpromisc6 nicpromisc7 nicpromisc8 nicproperty1 nicproperty2
screenshotpng setcredentials setlinkstate1 setlinkstate2 nicproperty3 nicproperty4 nicproperty5 nicproperty6 nicproperty7
setlinkstate3 setlinkstate4 setlinkstate5 setlinkstate6 nicproperty8 nictrace1 nictrace2 nictrace3 nictrace4 nictrace5
setlinkstate7 setlinkstate8 setvideomodehint teleport unplugcpu nictrace6 nictrace7 nictrace8 nictracefile1 nictracefile2
usbattach usbdetach vrde vrdeport vrdeproperty nictracefile3 nictracefile4 nictracefile5 nictracefile6
vrdevideochannelquality webcam recording addencpassword nictracefile7 nictracefile8 pause plugcpu poweroff reboot
removeencpassword removeallencpasswords keyboardputstring recording removeallencpasswords removeencpassword reset resume
keyboardputfile audioin audioout setscreenlayout changeuartmode1 savestate screenshotpng setcredentials setlinkstate1
changeuartmode2 vm-process-priority) setlinkstate2 setlinkstate3 setlinkstate4 setlinkstate5
setlinkstate6 setlinkstate7 setlinkstate8 setscreenlayout
setvideomodehint shutdown teleport unplugcpu usbattach usbdetach
vm-process-priority vrde vrdeport vrdeproperty
vrdevideochannelquality webcam )
_find_item_name 2 _find_item_name 2
subcommand=${COMP_WORDS[$((index+1))]} subcommand=${COMP_WORDS[$((index+1))]}
if [[ " ${items[@]} " == *" $subcommand "* ]]; then if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in case "${subcommand}" in
keyboardputfile|nictracefile[1-8]) keyboardputfile|nictracefile[1-8])
[[ ${prev} == "nictracefile"* ]] && \ [[ ${prev} == "nictracefile"* ]] && \
@@ -864,14 +868,10 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "delete tcp COMPREPLY=( $(compgen -W "delete tcp
udp" -- ${cur}) ) udp" -- ${cur}) )
;; ;;
audioin|audioout|setlinkstate[1-8])
[[ ${prev} == "setlinkstate"* ]] && \
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;;
clipboard) clipboard)
[[ ${prev} == "clipboard" ]] && \ [[ ${prev} == "clipboard" ]] && \
COMPREPLY=( $(compgen -W "disabled hosttoguest COMPREPLY=( $(compgen -W "mode filetransfers" \
guesttohost bidirectional" -- ${cur}) ) -- ${cur}) )
;; ;;
draganddrop) draganddrop)
[[ ${prev} == "draganddrop" ]] && \ [[ ${prev} == "draganddrop" ]] && \
@@ -884,13 +884,13 @@ _VBoxManage() {
;; ;;
recording) recording)
[[ ${prev} == "recording" ]] && \ [[ ${prev} == "recording" ]] && \
COMPREPLY=( $(compgen -W "on off screens COMPREPLY=( $(compgen -W "filename maxfilesize
filename videores videorate videofps maxtime maxtime off on screens videofps videorate
maxfilesize" -- ${cur}) ) videores" -- ${cur}) )
case "${prev}" in case "${prev}" in
screens) screens)
COMPREPLY=( $(compgen -W "all none COMPREPLY=( $(compgen -W "all none
<screen>" -- ${cur}) ) <screen-ID>" -- ${cur}) )
;; ;;
filename) filename)
COMPREPLY=( $(compgen -f -- ${cur}) ) COMPREPLY=( $(compgen -f -- ${cur}) )
@@ -930,26 +930,54 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "yes no" -- ${cur}) ) COMPREPLY=( $(compgen -W "yes no" -- ${cur}) )
;; ;;
addencpassword) addencpassword)
tmp=(--host --port --maxdowntime --passwordfile tmp=( --removeonsuspend )
--password)
_get_excluded_items "${tmp[@]}" _get_excluded_items "${tmp[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
changeuartmode[1-2]) changeuartmode[1-2])
tmp=(disconnected server client tcpserver tcpclient tmp=(disconnected serverpipe-name clientpipe-name
file "<devicename>") tcpserverport tcpclienthostname:port filefilename
device-name)
_get_excluded_items "${tmp[@]}" _get_excluded_items "${tmp[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
;; ;;
vm-process-priority) vm-process-priority)
COMPREPLY=( $(compgen -W "default flat low normal COMPREPLY=( $(compgen -W "default flat low normal
high" -- ${cur}) ) high" -- ${cur}) )
;; ;;
setscreenlayout)
if [[ "${prev}" != "${subcommand}" ]]; then
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
fi
;;
shutdown)
COMPREPLY=( $(compgen -W "--force" -- ${cur}) )
;;
esac esac
elif [[ ${prev} == "--passwordfile" || ${prev} == "--capturefile" ]]; then
COMPREPLY=( $(compgen -f -- ${cur}) )
else else
case "${prev}" in
--passwordfile|--capturefile|screenshotpng|\
keyboardputfile|nictracefile[1-8])
COMPREPLY=( $(compgen -f -- ${cur}) )
;;
audioin|audioout|autostart-enabled[1-4]|filetransfers|\
nictrace[1-8]|setlinkstate[1-8]|vrde)
COMPREPLY=( $(compgen -W "on off" -- ${cur}) )
;;
--allowlocallogon)
COMPREPLY=( $(compgen -W "yes no" -- ${cur}) )
;;
mode)
COMPREPLY=( $(compgen -W "disabled hosttoguest
guesttohost bidirectional" -- ${cur}) )
;;
esac
[[ ${#COMPREPLY[@]} -eq 0 ]] && \ [[ ${#COMPREPLY[@]} -eq 0 ]] && \
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
fi fi