mirror of
https://github.com/gryf/vboxmanage-bash-completion.git
synced 2025-12-17 11:30:23 +01:00
Added new subcommand for debugvm
VBoxManage removed "debug" from list of commands in help, leaving only description for "debugvm" in section "Introspection and guest debugging" below all of the list, so that it is needed for adding "debugvm" to the list of available commands manually. Also "stack", new subcommand was added to "debugvm".
This commit is contained in:
@@ -6,7 +6,7 @@ script. However, in some point of time I've decided to rewrite it almost from
|
||||
scratch.
|
||||
|
||||
Current version of script was written and tested against VBoxManage in version
|
||||
5.0.40, and supports all commands (in some extent ;)).
|
||||
5.1.26, and supports all commands (in some extent ;)).
|
||||
|
||||
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:
|
||||
|
||||
14
VBoxManage
14
VBoxManage
@@ -4,6 +4,7 @@
|
||||
# URL: https://bitbucket.org/gryf/vboxmanage-bash-completion
|
||||
# URL: https://github.com/gryf/vboxmanage-bash-completion
|
||||
# License: 3-clause BSD-style license (see LICENSE file)
|
||||
# Version: 5.1.26
|
||||
|
||||
_VBoxManage() {
|
||||
local cur prev opts cmd subcommand tmp items name index result
|
||||
@@ -440,6 +441,10 @@ _VBoxManage() {
|
||||
sort | \
|
||||
uniq)
|
||||
|
||||
# add debugvm command manually, since it's described differently in
|
||||
# vboxmanage help
|
||||
opts="${opts} debugvm"
|
||||
|
||||
if [[ ${cur} == "-q" || ${COMP_CWORD} -eq 1 ]] ; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
@@ -805,9 +810,9 @@ _VBoxManage() {
|
||||
fi
|
||||
;;
|
||||
|
||||
debugvm)
|
||||
"debugvm")
|
||||
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
|
||||
_vms_comp runningvms
|
||||
else
|
||||
@@ -824,7 +829,7 @@ _VBoxManage() {
|
||||
_get_excluded_items "${items[@]}"
|
||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||
;;
|
||||
getregisters|setregisters)
|
||||
getregisters|setregisters|stack)
|
||||
_get_excluded_items "--cpu"
|
||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||
;;
|
||||
@@ -835,7 +840,7 @@ _VBoxManage() {
|
||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||
;;
|
||||
statistics)
|
||||
items=(--reset --pattern)
|
||||
items=(--reset --pattern --descriptions)
|
||||
_get_excluded_items "${items[@]}"
|
||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||
;;
|
||||
@@ -848,7 +853,6 @@ _VBoxManage() {
|
||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||
;;
|
||||
esac
|
||||
_get_excluded_items "--descriptions"
|
||||
COMPREPLY+=( $(compgen -W "$result" -- ${cur}) )
|
||||
else
|
||||
[[ "${prev}" == "--filename" ]] && \
|
||||
|
||||
Reference in New Issue
Block a user