aboutsummaryrefslogtreecommitdiffstats
path: root/src/_virtualbox
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2022-12-23 20:55:17 +0900
committerShohei YOSHIDA <syohex@gmail.com>2022-12-23 20:55:17 +0900
commit2228daef0eb4744dbb00df8a9c7a04de27779d7d (patch)
tree21ca24e0ab32ff894ad7bf6198b4ed449afac19d /src/_virtualbox
parentMerge pull request #965 from zsh-users/add-unattended (diff)
downloadzsh-completions-2228daef0eb4744dbb00df8a9c7a04de27779d7d.tar
zsh-completions-2228daef0eb4744dbb00df8a9c7a04de27779d7d.tar.gz
zsh-completions-2228daef0eb4744dbb00df8a9c7a04de27779d7d.tar.bz2
zsh-completions-2228daef0eb4744dbb00df8a9c7a04de27779d7d.tar.lz
zsh-completions-2228daef0eb4744dbb00df8a9c7a04de27779d7d.tar.xz
zsh-completions-2228daef0eb4744dbb00df8a9c7a04de27779d7d.tar.zst
zsh-completions-2228daef0eb4744dbb00df8a9c7a04de27779d7d.zip
Add snapshot subcommand completion
Diffstat (limited to 'src/_virtualbox')
-rw-r--r--src/_virtualbox44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/_virtualbox b/src/_virtualbox
index ef4062a..9edd8d3 100644
--- a/src/_virtualbox
+++ b/src/_virtualbox
@@ -165,7 +165,7 @@ _vboxmanage() {
&& ret=0
;;
(snapshot)
- # TODO
+ _vboxmanage_snapshot
;;
(closemedium)
_arguments \
@@ -544,6 +544,48 @@ _vboxmanage_unattended() {
return $ret
}
+(( $+functions[_vboxmanage_snapshot] )) ||
+_vboxmanage_snapshot() {
+ local ret=1
+
+ _arguments -C \
+ '1: :_vboxmachines' \
+ '2: :(take delete restore restorecurrent edit list showvminfo)' \
+ '*:: :->arg' \
+ && ret=0
+
+ case $state in
+ (arg)
+ local subcommand=$words[2]
+ compset -n 2
+ case $words[1] in
+ (take)
+ _arguments \
+ '--description=[Specifies a description of the snapshot]:description' \
+ '--live[Specifies that the VM is not stopped while you create the snapshot]' \
+ '--uniquename=[unique name]' \
+ && ret=0
+ ;;
+ (edit)
+ _arguments \
+ '--current[Specifies that you update the current version of the snapshot]' \
+ '--description=[Specifies a new description for the snapshot]:description' \
+ '--name=[Specifies a new name for the snapshot]:name' \
+ && ret=0
+ ;;
+ (list)
+ _arguments \
+ '--details[Specifies that the output shows detailed information about the snapshot]' \
+ '--machinereadable[Specifies that the output is shown in a machine-readable format]' \
+ && ret=0
+ ;;
+ esac
+ ;;
+ esac
+
+ return $ret
+}
+
(( $+functions[_vboxmanage_bandwidthctl] )) ||
_vboxmanage_bandwidthctl() {
local ret=1