diff options
| author | Shohei YOSHIDA <syohex@gmail.com> | 2022-12-24 22:39:10 +0900 |
|---|---|---|
| committer | Shohei YOSHIDA <syohex@gmail.com> | 2022-12-24 22:39:10 +0900 |
| commit | a6f3ed261637ec5a5cb1b4cba602319f76ab6cea (patch) | |
| tree | 29f40c93dd32b25cb88203a5870ab1800a13b6fa /src/_virtualbox | |
| parent | Add usbdevsource subcommand completion (diff) | |
| download | zsh-completions-a6f3ed261637ec5a5cb1b4cba602319f76ab6cea.tar zsh-completions-a6f3ed261637ec5a5cb1b4cba602319f76ab6cea.tar.gz zsh-completions-a6f3ed261637ec5a5cb1b4cba602319f76ab6cea.tar.bz2 zsh-completions-a6f3ed261637ec5a5cb1b4cba602319f76ab6cea.tar.lz zsh-completions-a6f3ed261637ec5a5cb1b4cba602319f76ab6cea.tar.xz zsh-completions-a6f3ed261637ec5a5cb1b4cba602319f76ab6cea.tar.zst zsh-completions-a6f3ed261637ec5a5cb1b4cba602319f76ab6cea.zip | |
Implement sharedfolder subcommand completion
Diffstat (limited to 'src/_virtualbox')
| -rw-r--r-- | src/_virtualbox | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/_virtualbox b/src/_virtualbox index e913f47..bd4669c 100644 --- a/src/_virtualbox +++ b/src/_virtualbox @@ -294,10 +294,10 @@ _vboxmanage() { _vboxmanage_usbfilter && ret=0 ;; (sharedfolder) - # TODO + _vboxmanage_sharedfolder && ret=0 ;; (guestproperty) - _vboxmanage_guestproperty + _vboxmanage_guestproperty && ret=0 ;; (guestcontrol) # TODO @@ -921,6 +921,43 @@ _vboxmanage_usbfilter() { return $ret } +(( $+functions[_vboxmanage_sharedfolder] )) || +_vboxmanage_sharedfolder() { + local ret=1 + + _arguments -C \ + '1: :(add remove)' \ + '*:: :->arg' \ + && ret=0 + + case $state in + (arg) + case $words[1] in + (add) + _arguments \ + '--name=[Specifies the name of the share]:name' \ + '--hostpath=[Specifies the absolute path of the folder or directory on the host OS]: :_files -/' \ + '--readonly[Specifies that the share has only read-only access to files at the host path]' \ + '--transient[Specifies that the share is transient]' \ + '--automount[Specifies that the share is automatically mounted]' \ + '--auto-mount-point=[Specifies the mount point of the share]: :_files -/' \ + '1: :_vboxmachines' \ + && ret=0 + ;; + (remove) + _arguments \ + '--name=[Specifies the name of the share]:name' \ + '--transient[Specifies that the share is transient]' \ + '1: :_vboxmachines' \ + && ret=0 + ;; + esac + ;; + esac + + return $ret +} + (( $+functions[_vboxmanage_guestproperty] )) || _vboxmanage_guestproperty() { local ret=1 |
