From fbdd259cacf386f1f28a50984a2278c179a33991 Mon Sep 17 00:00:00 2001 From: gryf Date: Sun, 8 Oct 2017 09:11:20 +0200 Subject: [PATCH] Added support for usbdevsource command --- VBoxManage | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/VBoxManage b/VBoxManage index e0350d8..038e45f 100644 --- a/VBoxManage +++ b/VBoxManage @@ -2127,6 +2127,29 @@ _VBoxManage() { fi fi ;; + + usbdevsource) + if [[ COMP_CWORD -ge 3 ]]; then + subcommand="${COMP_WORDS[2]}" + if [[ $subcommand == "${cmd}" ]]; then + subcommand="${COMP_WORDS[3]}" + fi + fi + + if [[ ${prev} == ${cmd} ]]; then + COMPREPLY=( $(compgen -W "add remove" -- ${cur}) ) + else + if [[ ${#COMPREPLY[@]} -eq 0 ]]; then + case "${subcommand}" in + add) + local items=(--address --backend) + _get_excluded_items "${items[@]}" + COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) + ;; + esac + fi + fi + ;; esac } complete -o default -F _VBoxManage VBoxManage