From 3404afa4418ec1c49948963e41e50c253539f6a7 Mon Sep 17 00:00:00 2001 From: Roman Dobosz Date: Thu, 2 Nov 2023 18:14:25 +0100 Subject: [PATCH] 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. --- VBoxManage | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VBoxManage b/VBoxManage index 9ecc1c7..e8e753b 100644 --- a/VBoxManage +++ b/VBoxManage @@ -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 :