From d01352a68a502ec81e1feda0c441fe9bad513ff5 Mon Sep 17 00:00:00 2001 From: Roman Dobosz Date: Fri, 17 Mar 2023 19:07:38 +0100 Subject: [PATCH] Sorted commands --- VBoxManage | 220 ++++++++++++++++++++++++++--------------------------- 1 file changed, 110 insertions(+), 110 deletions(-) diff --git a/VBoxManage b/VBoxManage index 8cc2663..e1aba65 100644 --- a/VBoxManage +++ b/VBoxManage @@ -655,41 +655,6 @@ _VBoxManage() { fi ;; - cloudprofile) - if [[ " ${COMP_WORDS[*]} " != *" --provider"* || - " ${COMP_WORDS[*]} " != *" --profile"* ]]; then - items=(--provider --profile) - else - [[ " ${COMP_WORDS[*]} " != *" add"* && - " ${COMP_WORDS[*]} " != *" update"* && - " ${COMP_WORDS[*]} " != *" delete"* && - " ${COMP_WORDS[*]} " != *" show"* ]] && - items=(add update delete show) - fi - _get_excluded_items "${items[@]}" - COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) - - if [[ " ${COMP_WORDS[*]} " == *" add"* || - " ${COMP_WORDS[*]} " == *" update"* ]]; then - COMPREPLY=( $(compgen -W "--clouduser --fingerprint --keyfile - --passphrase --tenancy --compartment --region" -- ${cur}) ) - else - case "${prev}" in - --provider) - COMPREPLY=() - _cloudproviders_comp - ;; - --profile) - COMPREPLY=() - _cloudprofiles_comp - ;; - --keyfile) - COMPREPLY=( $(compgen -f -- ${cur}) ) - ;; - esac - fi - ;; - cloud) if [ "${prev}" == "cloud" ]; then items=(--provider --profile network) @@ -814,6 +779,41 @@ _VBoxManage() { fi ;; + cloudprofile) + if [[ " ${COMP_WORDS[*]} " != *" --provider"* || + " ${COMP_WORDS[*]} " != *" --profile"* ]]; then + items=(--provider --profile) + else + [[ " ${COMP_WORDS[*]} " != *" add"* && + " ${COMP_WORDS[*]} " != *" update"* && + " ${COMP_WORDS[*]} " != *" delete"* && + " ${COMP_WORDS[*]} " != *" show"* ]] && + items=(add update delete show) + fi + _get_excluded_items "${items[@]}" + COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) + + if [[ " ${COMP_WORDS[*]} " == *" add"* || + " ${COMP_WORDS[*]} " == *" update"* ]]; then + COMPREPLY=( $(compgen -W "--clouduser --fingerprint --keyfile + --passphrase --tenancy --compartment --region" -- ${cur}) ) + else + case "${prev}" in + --provider) + COMPREPLY=() + _cloudproviders_comp + ;; + --profile) + COMPREPLY=() + _cloudprofiles_comp + ;; + --keyfile) + COMPREPLY=( $(compgen -f -- ${cur}) ) + ;; + esac + fi + ;; + controlvm) if [[ ${prev} == ${cmd} ]]; then _vms_comp runningvms @@ -2801,81 +2801,6 @@ _VBoxManage() { fi ;; - unregistervm) - if [[ ${prev} == ${cmd} ]]; then - _vms_comp vms - else - local items=(--delete) - _get_excluded_items "${items[@]}" - COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) - fi - ;; - - usbfilter) - 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 modify remove" -- ${cur}) ) - else - case "${prev}" in - --target) - _vms_comp vms - COMPREPLY+=( $(compgen -W "global" -- ${cur}) ) - ;; - --action) - COMPREPLY=( $(compgen -W "ignore hold" -- ${cur}) ) - ;; - --active|--remote) - COMPREPLY=( $(compgen -W "yes no" -- ${cur}) ) - ;; - esac - if [[ ${#COMPREPLY[@]} -eq 0 ]]; then - case "${subcommand}" in - add|modify) - local items=(--target --name --action --active - --vendorid --productid --revision --manufacturer - --product --remote --serialnumber --maskedinterfaces) - _get_excluded_items "${items[@]}" - COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) - ;; - remove) - local items=(--target) - _get_excluded_items "${items[@]}" - COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) - ;; - esac - 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 - ;; - unattended) if [[ COMP_CWORD -ge 3 ]]; then subcommand="${COMP_WORDS[2]}" @@ -2933,6 +2858,81 @@ _VBoxManage() { fi ;; + unregistervm) + if [[ ${prev} == ${cmd} ]]; then + _vms_comp vms + else + local items=(--delete) + _get_excluded_items "${items[@]}" + COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) + 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 + ;; + + usbfilter) + 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 modify remove" -- ${cur}) ) + else + case "${prev}" in + --target) + _vms_comp vms + COMPREPLY+=( $(compgen -W "global" -- ${cur}) ) + ;; + --action) + COMPREPLY=( $(compgen -W "ignore hold" -- ${cur}) ) + ;; + --active|--remote) + COMPREPLY=( $(compgen -W "yes no" -- ${cur}) ) + ;; + esac + if [[ ${#COMPREPLY[@]} -eq 0 ]]; then + case "${subcommand}" in + add|modify) + local items=(--target --name --action --active + --vendorid --productid --revision --manufacturer + --product --remote --serialnumber --maskedinterfaces) + _get_excluded_items "${items[@]}" + COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) + ;; + remove) + local items=(--target) + _get_excluded_items "${items[@]}" + COMPREPLY=( $(compgen -W "$result" -- ${cur}) ) + ;; + esac + fi + fi + ;; + esac } complete -o default -F _VBoxManage VBoxManage