Compare commits

..

3 Commits

Author SHA1 Message Date
gryf 3404afa441 Added support for other names than vboxmanage.
Currently the completion script will be available for commands:
VBoxManage and vboxmanage. With this commit, renaming/linking this
script with another name will also make that name to be included to
completion.

For example, with alias:

    $ alias vb="VBoxManage"

linkig completion script into new name an source it:

    $ cd /path/of/completion/script/
    $ ln -s VBoxManage vb
    # source vb

will start to complete vb command.
2023-11-02 18:14:29 +01:00
gryf ab6d9f7cd9 Added missing completions for cloud related commands.
Also, removed trailing spaces.
2023-11-02 18:11:41 +01:00
gryf 3bb795a1e3 Bump to 7.0.10 2023-09-11 10:30:29 +02:00
2 changed files with 36 additions and 22 deletions
+1 -1
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
7.0.8, and should contain all commands and their options.
7.0.10, and should contain all commands and their options.
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:
+21 -7
View File
@@ -4,7 +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: 7.0.8
# Version: 7.0.10
_VBoxManage() {
@@ -677,11 +677,12 @@ _VBoxManage() {
_cloudprofiles_comp
;;
list)
COMPREPLY=( $(compgen -W "instances images" -- ${cur}) )
COMPREPLY=( $(compgen -W "instances images vnicattachments"
-- ${cur}) )
;;
instance)
COMPREPLY=( $(compgen -W "create info terminate start
pause" -- ${cur}) )
pause reset" -- ${cur}) )
;;
image)
COMPREPLY=( $(compgen -W "create info delete import
@@ -692,6 +693,13 @@ _VBoxManage() {
COMPREPLY=( $(compgen -W "setup create" -- ${cur}) )
fi
;;
reset)
COMPREPLY=( $(compgen -W "--id" -- ${cur}) )
;;
vnicattachments)
COMPREPLY=( $(compgen -W "--compartment-id --filter"
-- ${cur}) )
;;
esac
if [[ " ${COMP_WORDS[*]} " == *" list images"* ||
" ${COMP_WORDS[*]} " == *" list instances"* ]]; then
@@ -1425,7 +1433,7 @@ _VBoxManage() {
if [[ " ${items[*]} " == *" $subcommand "* ]]; then
case "${subcommand}" in
run)
items=( --domain --dos2unix --exe
items=( --arg0 --domain --dos2unix --exe
--ignore-operhaned-processes --profile --putenv
--quiet --timeout --unix2dos --unquoted-args
--username --verbose -- )
@@ -1445,9 +1453,10 @@ _VBoxManage() {
;;
start)
items=( --domain --exe --ignore-orphaned-processes
--profile --putenv --quiet --timeout
--unquoted-args --username --verbose -- )
items=( --arg0 --domain --exe
--ignore-orphaned-processes --profile --putenv
--quiet --timeout --unquoted-args --username
--verbose -- )
[[ " ${COMP_WORDS[*]} " != *" --password "* ||
" ${COMP_WORDS[*]} " != *" --passwordfile "* ]] &&
@@ -2855,4 +2864,9 @@ _VBoxManage() {
complete -o default -F _VBoxManage VBoxManage
complete -o default -F _VBoxManage vboxmanage
if [[ "${BASH_SOURCE[0]}" != 'VBoxManage' &&
"${BASH_SOURCE[0]}" != 'vboxmanage' ]]; then
complete -o default -F _VBoxManage $(basename "${BASH_SOURCE[0]}")
fi
# vim: set ft=sh tw=80 sw=4 et :