mirror of
https://github.com/gryf/vboxmanage-bash-completion.git
synced 2025-12-17 11:30:23 +01:00
Added guestproperty hostonlyif import
This commit is contained in:
3
README
3
README
@@ -23,6 +23,9 @@ Current version of script was written and tested against VBoxManage in version
|
|||||||
- extpack
|
- extpack
|
||||||
- getextradata
|
- getextradata
|
||||||
- guestcontrol
|
- guestcontrol
|
||||||
|
- guestproperty
|
||||||
|
- hostonlyif
|
||||||
|
- import
|
||||||
- list
|
- list
|
||||||
- registervm
|
- registervm
|
||||||
- setextradata
|
- setextradata
|
||||||
|
|||||||
83
VBoxManage
83
VBoxManage
@@ -7,9 +7,6 @@
|
|||||||
#
|
#
|
||||||
# [1] Sebastian T. Hafner <sonix@own-hero.net>
|
# [1] Sebastian T. Hafner <sonix@own-hero.net>
|
||||||
#
|
#
|
||||||
# [ ] guestproperty
|
|
||||||
# [ ] hostonlyif
|
|
||||||
# [ ] import
|
|
||||||
# [ ] metrics
|
# [ ] metrics
|
||||||
# [ ] modifyhd
|
# [ ] modifyhd
|
||||||
# [ ] modifyvm
|
# [ ] modifyvm
|
||||||
@@ -1007,10 +1004,90 @@ _VBoxManage() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
guestproperty)
|
guestproperty)
|
||||||
|
items=(get set delete unset enumerate wait)
|
||||||
|
subcommand=${COMP_WORDS[2]}
|
||||||
|
|
||||||
|
if [[ "${prev}" == "${subcommand}" ]]; then
|
||||||
|
_vms_comp vms ${cur}
|
||||||
|
elif [[ " ${items[@]} " == *" $subcommand "* ]]; then
|
||||||
|
case "${subcommand}" in
|
||||||
|
get)
|
||||||
|
_get_excluded_items "--verbose"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
;;
|
||||||
|
set)
|
||||||
|
_get_excluded_items "--flags"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
;;
|
||||||
|
enumerate)
|
||||||
|
_get_excluded_items "--patterns"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
;;
|
||||||
|
wait)
|
||||||
|
items=(--timeout --fail-on-timeout)
|
||||||
|
_get_excluded_items "${items[@]}"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
[[ ${#COMPREPLY[@]} -eq 0 ]] && \
|
||||||
|
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
hostonlyif)
|
hostonlyif)
|
||||||
|
items=(ipconfig create remove)
|
||||||
|
subcommand=${COMP_WORDS[2]}
|
||||||
|
case "${prev}" in
|
||||||
|
ipconfig|remove)
|
||||||
|
_hostonlyif_comp ${cur}
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ ${#COMPREPLY[@]} -eq 0 && \
|
||||||
|
" ${items[@]} " == *" $subcommand "* ]]; then
|
||||||
|
case "${subcommand}" in
|
||||||
|
ipconfig)
|
||||||
|
items=(--dhcp --ip --ipv6 --netmask --netmasklengthv6)
|
||||||
|
[[ " ${COMP_WORDS[@]} " == *" --dhcp "* ]] && items=()
|
||||||
|
[[ " ${COMP_WORDS[@]} " == *" --ip "* ]] &&
|
||||||
|
items=(--netmask)
|
||||||
|
[[ " ${COMP_WORDS[@]} " == *" --netmask "* ]] &&
|
||||||
|
items=(--ip)
|
||||||
|
[[ " ${COMP_WORDS[@]} " == *" --ipv6 "* ]] &&
|
||||||
|
items=(--netmasklengthv6)
|
||||||
|
[[ " ${COMP_WORDS[@]} " == *" --netmasklengthv6 "* ]] &&
|
||||||
|
items=(--ipv6)
|
||||||
|
|
||||||
|
_get_excluded_items "${items[@]}"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
[[ ${COMP_CWORD} -eq 2 ]] && \
|
||||||
|
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
import)
|
import)
|
||||||
|
items=(--options)
|
||||||
|
if [[ "${prev}" == "import" ]]; then
|
||||||
|
COMPREPLY=( $(compgen -o plusdirs -f -X '!@(*.ovf|*.ova)' \
|
||||||
|
-- ${cur}) )
|
||||||
|
else
|
||||||
|
case "${prev}" in
|
||||||
|
--options)
|
||||||
|
COMPREPLY=( $(compgen -W "keepallmacs keepnatmacs" \
|
||||||
|
-- ${cur}) )
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
[[ " ${COMP_WORDS[@]} " != *" --dry-run"* &&
|
||||||
|
" ${COMP_WORDS[@]} " != *" -n"* ]] &&
|
||||||
|
items+=(-n --dry-run)
|
||||||
|
|
||||||
|
if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
|
||||||
|
_get_excluded_items "${items[@]}"
|
||||||
|
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
|
||||||
|
fi
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
list)
|
list)
|
||||||
if [[ ${prev} == ${cmd} ]]; then
|
if [[ ${prev} == ${cmd} ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user