mirror of
https://github.com/gryf/vboxmanage-bash-completion.git
synced 2025-12-17 03:20:20 +01:00
Updated cloud related commands
This commit is contained in:
94
VBoxManage
94
VBoxManage
@@ -656,19 +656,24 @@ _VBoxManage() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
cloudprofile)
|
cloudprofile)
|
||||||
if [[ " ${COMP_WORDS[@]} " != *" --provider"* ||
|
if [[ " ${COMP_WORDS[*]} " != *" --provider"* ||
|
||||||
" ${COMP_WORDS[@]} " != *" --profile"* ]]; then
|
" ${COMP_WORDS[*]} " != *" --profile"* ]]; then
|
||||||
items=(--provider --profile)
|
items=(--provider --profile)
|
||||||
else
|
else
|
||||||
[[ " ${COMP_WORDS[@]} " != *" add"* &&
|
[[ " ${COMP_WORDS[*]} " != *" add"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" update"* &&
|
" ${COMP_WORDS[*]} " != *" update"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" delete"* &&
|
" ${COMP_WORDS[*]} " != *" delete"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" show"* ]] &&
|
" ${COMP_WORDS[*]} " != *" show"* ]] &&
|
||||||
items=(add update delete show)
|
items=(add update delete show)
|
||||||
fi
|
fi
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
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
|
case "${prev}" in
|
||||||
--provider)
|
--provider)
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
@@ -678,27 +683,26 @@ _VBoxManage() {
|
|||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
_cloudprofiles_comp
|
_cloudprofiles_comp
|
||||||
;;
|
;;
|
||||||
|
--keyfile)
|
||||||
|
COMPREPLY=( $(compgen -f -- ${cur}) )
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" add"* ||
|
|
||||||
" ${COMP_WORDS[@]} " == *" update"* ]]; then
|
|
||||||
COMPREPLY=( $(compgen -W "--clouduser --fingerprint --keyfile
|
|
||||||
--passphrase --tenancy --compartment" -- ${cur}) )
|
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
cloud)
|
cloud)
|
||||||
if [ "${prev}" == "cloud" ]; then
|
if [ "${prev}" == "cloud" ]; then
|
||||||
items=(--provider --profile network)
|
items=(--provider --profile network)
|
||||||
elif [[ " ${COMP_WORDS[@]} " == *" network"* ]]; then
|
elif [[ " ${COMP_WORDS[*]} " == *" network"* ]]; then
|
||||||
items=(update delete info)
|
items=(update delete info)
|
||||||
elif [[ " ${COMP_WORDS[@]} " != *" --provider"* ||
|
elif [[ " ${COMP_WORDS[*]} " != *" --provider"* ||
|
||||||
" ${COMP_WORDS[@]} " != *" --profile"* ]]; then
|
" ${COMP_WORDS[*]} " != *" --profile"* ]]; then
|
||||||
items=(--provider --profile)
|
items=(--provider --profile)
|
||||||
else
|
else
|
||||||
[[ " ${COMP_WORDS[@]} " != *" list"* &&
|
[[ " ${COMP_WORDS[*]} " != *" list"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" instance"* &&
|
" ${COMP_WORDS[*]} " != *" instance"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" network"* &&
|
" ${COMP_WORDS[*]} " != *" network"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" image"* ]] &&
|
" ${COMP_WORDS[*]} " != *" image"* ]] &&
|
||||||
items=(list instance image network)
|
items=(list instance image network)
|
||||||
fi
|
fi
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
@@ -724,24 +728,24 @@ _VBoxManage() {
|
|||||||
export" -- ${cur}) )
|
export" -- ${cur}) )
|
||||||
;;
|
;;
|
||||||
network) # TODO: differentiate between setup/create and update/delete/info
|
network) # TODO: differentiate between setup/create and update/delete/info
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" --provider"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" --provider"* ]]; then
|
||||||
COMPREPLY=( $(compgen -W "setup create" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "setup create" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" list images"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" list images"* ||
|
||||||
|
" ${COMP_WORDS[*]} " == *" list instances"* ]]; then
|
||||||
items=(--state --compartment-id)
|
items=(--state --compartment-id)
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" instance create"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" instance create"* ]]; then
|
||||||
items=( --domain-name --display-name --shape --subnet
|
items=( --domain-name --display-name --shape --subnet
|
||||||
--publicip --boot-disk-size --privateip --public-ssh-key
|
--publicip --boot-disk-size --privateip --public-ssh-key
|
||||||
--launch-mode --cloud-init-script-path )
|
--launch-mode --cloud-init-script-path )
|
||||||
[[ " ${COMP_WORDS[@]} " != *" --image-id"* &&
|
[[ " ${COMP_WORDS[*]} " != *" --image-id"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" --boot-volume-id"* ]] &&
|
" ${COMP_WORDS[*]} " != *" --boot-volume-id"* ]] &&
|
||||||
items+=(--image-id --boot-volume-id)
|
items+=(--image-id --boot-volume-id)
|
||||||
|
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
@@ -757,57 +761,55 @@ _VBoxManage() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" instance info"* ||
|
if [[ " ${COMP_WORDS[*]} " == *" instance info"* ||
|
||||||
" ${COMP_WORDS[@]} " == *" instance terminate"* ||
|
" ${COMP_WORDS[*]} " == *" instance terminate"* ||
|
||||||
" ${COMP_WORDS[@]} " == *" instance start"* ||
|
" ${COMP_WORDS[*]} " == *" instance start"* ||
|
||||||
" ${COMP_WORDS[@]} " == *" instance pause"* ]]; then
|
" ${COMP_WORDS[*]} " == *" instance pause"* ]]; then
|
||||||
COMPREPLY=( $(compgen -W "--id" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "--id" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" image create"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" image create"* ]]; then
|
||||||
items=(--display-name --bucket-name --object-name --instance-id)
|
items=(--display-name --bucket-name --object-name --instance-id)
|
||||||
|
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" image info"* ||
|
if [[ " ${COMP_WORDS[*]} " == *" image info"* ||
|
||||||
" ${COMP_WORDS[@]} " == *" image delete"* ]]; then
|
" ${COMP_WORDS[*]} " == *" image delete"* ]]; then
|
||||||
COMPREPLY=( $(compgen -W "--id" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "--id" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" image import"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" image import"* ]]; then
|
||||||
COMPREPLY=( $(compgen -W "--id --bucket-name
|
COMPREPLY=( $(compgen -W "--id --bucket-name
|
||||||
--object-name" -- ${cur}) )
|
--object-name" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" image export"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" image export"* ]]; then
|
||||||
COMPREPLY=( $(compgen -W "--id --display-name --bucket-name
|
COMPREPLY=( $(compgen -W "--id --display-name --bucket-name
|
||||||
--object-name" -- ${cur}) )
|
--object-name" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" network setup"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" network setup"* ]]; then
|
||||||
items=( --local-gateway-iso --gateway-os-name
|
items=( --compartment-id --gateway-os-name --gateway-os-version
|
||||||
--gateway-os-version --gateway-shape --tunnel-network-name
|
--gateway-shape --proxy --tunnel-network-name
|
||||||
--tunnel-network-range --guest-additions-iso --proxy
|
--tunnel-network-range )
|
||||||
--compartment-id )
|
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" network create"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" network create"* ]]; then
|
||||||
items=( --name --network-id )
|
items=( --name --network-id )
|
||||||
[[ " ${COMP_WORDS[@]} " != *" --enable"* &&
|
[[ " ${COMP_WORDS[*]} " != *" --enable"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" --disable"* ]] &&
|
" ${COMP_WORDS[*]} " != *" --disable"* ]] &&
|
||||||
items+=(--enable --disable)
|
items+=(--enable --disable)
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" network update"* ]]; then
|
if [[ " ${COMP_WORDS[*]} " == *" network update"* ]]; then
|
||||||
items=( --name --network-id )
|
items=( --name --network-id )
|
||||||
[[ " ${COMP_WORDS[@]} " != *" --enable"* &&
|
[[ " ${COMP_WORDS[*]} " != *" --enable"* &&
|
||||||
" ${COMP_WORDS[@]} " != *" --disable"* ]] &&
|
" ${COMP_WORDS[*]} " != *" --disable"* ]] &&
|
||||||
items+=(--enable --disable)
|
items+=(--enable --disable)
|
||||||
_get_excluded_items "${items[@]}"
|
_get_excluded_items "${items[@]}"
|
||||||
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
if [[ " ${COMP_WORDS[@]} " == *" network info"* ||
|
if [[ " ${COMP_WORDS[*]} " == *" network info"* ||
|
||||||
" ${COMP_WORDS[@]} " == *" network delete"* ]]; then
|
" ${COMP_WORDS[*]} " == *" network delete"* ]]; then
|
||||||
COMPREPLY=( $(compgen -W "--name" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "--name" -- ${cur}) )
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user