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:
2017-10-08 10:14:13 +02:00
parent fbdd259cac
commit 9b06c430fd
2 changed files with 15 additions and 11 deletions

View File

@@ -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:

View File

@@ -1,9 +1,10 @@
# bash command-line completion for VBoxManage command
#
# Author: Roman 'gryf' Dobosz <gryf73@gmail.com>
# URL: https://bitbucket.org/gryf/vboxmanage-bash-completion
# 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" ]] && \
@@ -989,10 +993,10 @@ _VBoxManage() {
;;
guestcontrol)
local items=(run start copyfrom copyto mkdir createdir
createdirectory rmdir removedir removedirectory removefile rm mv
move ren rename mktemp createtemp createtemporary stat list
closeprocess closesession updatega updateguestadditions
local items=(run start copyfrom copyto mkdir createdir
createdirectory rmdir removedir removedirectory removefile rm mv
move ren rename mktemp createtemp createtemporary stat list
closeprocess closesession updatega updateguestadditions
updateadditions watch)
if [[ ${prev} == ${cmd} ]]; then