Added createhd command

This commit is contained in:
2015-04-09 19:49:50 +02:00
parent 2749f0b77f
commit 878b1e6b01
2 changed files with 32 additions and 4 deletions

7
README
View File

@@ -1,10 +1,10 @@
VBoxManage bash completion script. VBoxManage bash completion script.
This version of the completion was initially based on Sebastian T. Hafner This version of the completion was initially based on Sebastian T. Hafner
script. However, in some point of time I've decided to rewrite it almost from script. However, in some point of time I've decided to rewrite it almost from
scratch. scratch.
Current version of script was written and tested against VBoxManage in version Current version of script was written and tested against VBoxManage in version
4.3.18, and supports commands: 4.3.18, and supports commands:
- adoptstate - adoptstate
@@ -14,6 +14,7 @@ Current version of script was written and tested against VBoxManage in version
- closemedium - closemedium
- controlvm - controlvm
- convertfromraw - convertfromraw
- createhd
- list - list
- showhdinfo - showhdinfo
- showvminfo - showvminfo

View File

@@ -15,7 +15,7 @@
# [x] closemedium # [x] closemedium
# [x] controlvm # [x] controlvm
# [x] convertfromraw # [x] convertfromraw
# [ ] createhd # [x] createhd
# [ ] createvm # [ ] createvm
# [ ] debugvm # [ ] debugvm
# [ ] dhcpserver # [ ] dhcpserver
@@ -553,6 +553,33 @@ _VBoxManage() {
fi fi
;; ;;
createhd) createhd)
items=(--filename --size --sizebyte --diffparent --format --variant)
if [[ ${prev} == ${cmd} ]]; then
COMPREPLY=( $(compgen -W "${items[*]}" -- ${cur}) )
else
[[ " ${COMP_WORDS[@]} " == *" --size "* ||
" ${COMP_WORDS[@]} " == *" --sizebyte "* ]] &&
items=(--filename --diffparent --format --variant)
_get_excluded_items "${items[@]}"
COMPREPLY=( $(compgen -W "$result" -- ${cur}) )
case "${prev}" in
--filename)
COMPREPLY=( $(compgen -- ${cur}) )
;;
--diffparent)
COMPREPLY=()
_hdd_comp ${cur}
;;
--format)
COMPREPLY=( $(compgen -W "VDI VMDK VHD" -- ${cur}) )
;;
--variant)
COMPREPLY=( $(compgen -W "Standard Fixed Split2G Stream
ESX" -- ${cur}) )
;;
esac
fi
;; ;;
createvm) createvm)
;; ;;