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.
This commit is contained in:
2023-11-02 18:14:25 +01:00
parent ab6d9f7cd9
commit 3404afa441

View File

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