diff options
| author | Shohei YOSHIDA <syohex@gmail.com> | 2022-12-23 14:12:29 +0900 |
|---|---|---|
| committer | Shohei YOSHIDA <syohex@gmail.com> | 2022-12-23 14:12:29 +0900 |
| commit | 0211e566da43c354cfb74e247bb7c81ce46ae04a (patch) | |
| tree | 86de058ca471e7806b76009daea778784fd4d4ea /src/_virtualbox | |
| parent | Merge pull request #961 from zsh-users/add-encryptvm (diff) | |
| download | zsh-completions-0211e566da43c354cfb74e247bb7c81ce46ae04a.tar zsh-completions-0211e566da43c354cfb74e247bb7c81ce46ae04a.tar.gz zsh-completions-0211e566da43c354cfb74e247bb7c81ce46ae04a.tar.bz2 zsh-completions-0211e566da43c354cfb74e247bb7c81ce46ae04a.tar.lz zsh-completions-0211e566da43c354cfb74e247bb7c81ce46ae04a.tar.xz zsh-completions-0211e566da43c354cfb74e247bb7c81ce46ae04a.tar.zst zsh-completions-0211e566da43c354cfb74e247bb7c81ce46ae04a.zip | |
Add bandwidthctl subcommand completion
Diffstat (limited to 'src/_virtualbox')
| -rw-r--r-- | src/_virtualbox | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/src/_virtualbox b/src/_virtualbox index 35d7d13..a2e04fb 100644 --- a/src/_virtualbox +++ b/src/_virtualbox @@ -218,7 +218,7 @@ _vboxmanage() { && ret=0 ;; (bandwidthctl) - # TODO + _vboxmanage_bandwidthctl ;; (showmediuminfo) _arguments \ @@ -455,6 +455,50 @@ _vboxmanage_encryptvm_addpassword() { '--new-password-id[specify the new ID for the password for encryption of the VM]:id' } +(( $+functions[_vboxmanage_bandwidthctl] )) || +_vboxmanage_bandwidthctl() { + local ret=1 + + _arguments -C \ + '1: :_vboxmachines' \ + '2: :(add list remove set)' \ + '*:: :->arg' \ + && ret=0 + + case $state in + (arg) + local subcommand=$words[2] + if (( $+functions[_vboxmanage_bandwidthctl_${subcommand}] )); then + compset -n 2 + _vboxmanage_bandwidthctl_${subcommand} && ret=0 + else + _arguments '*: :_files' && ret=0 + fi + ;; + esac + + return $ret +} + +(( $+functions[_vboxmanage_bandwidthctl_add] )) || +_vboxmanage_bandwidthctl_add() { + _arguments \ + '--limit=[Specifies the bandwidth limit for a bandwidth group]:limit' \ + '--type=[Specifies the type of the bandwidth group]: :(disk network)' +} + +(( $+functions[_vboxmanage_bandwidthctl_list] )) || +_vboxmanage_bandwidthctl_list() { + _arguments \ + '--machinereadable[Outputs the information about the bandwidth groups in name-value pairs]' +} + +(( $+functions[_vboxmanage_bandwidthctl_set] )) || +_vboxmanage_bandwidthctl_set() { + _arguments \ + '--limit=[Specifies the bandwidth limit for a bandwidth group]:limit' +} + (( $+functions[_vboxheadless] )) || _vboxheadless() { local ret=1 |
