diff options
| author | Shohei YOSHIDA <syohex@gmail.com> | 2022-12-25 12:52:22 +0900 |
|---|---|---|
| committer | Shohei YOSHIDA <syohex@gmail.com> | 2022-12-25 12:52:22 +0900 |
| commit | 46e5e954053cf0bdb33d318c5b9cf44e155da2dd (patch) | |
| tree | 426c413d9ebc1d958709dbb0869a9e8048a16bbc /src/_virtualbox | |
| parent | Add debugvm subcommand completion (diff) | |
| download | zsh-completions-46e5e954053cf0bdb33d318c5b9cf44e155da2dd.tar zsh-completions-46e5e954053cf0bdb33d318c5b9cf44e155da2dd.tar.gz zsh-completions-46e5e954053cf0bdb33d318c5b9cf44e155da2dd.tar.bz2 zsh-completions-46e5e954053cf0bdb33d318c5b9cf44e155da2dd.tar.lz zsh-completions-46e5e954053cf0bdb33d318c5b9cf44e155da2dd.tar.xz zsh-completions-46e5e954053cf0bdb33d318c5b9cf44e155da2dd.tar.zst zsh-completions-46e5e954053cf0bdb33d318c5b9cf44e155da2dd.zip | |
Add metrics subcommand completion
Diffstat (limited to 'src/_virtualbox')
| -rw-r--r-- | src/_virtualbox | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/src/_virtualbox b/src/_virtualbox index 1971a6f..13c13d1 100644 --- a/src/_virtualbox +++ b/src/_virtualbox @@ -306,7 +306,7 @@ _vboxmanage() { _vboxmanage_debugvm && ret=0 ;; (metrics) - # TODO + _vboxmanage_metrics && ret=0 ;; (natnetwork) _vboxmanage_natnetwork && ret=0 @@ -1204,6 +1204,53 @@ _vboxmanage_debugvm() { return $ret } +(( $+functions[_vboxmanage_metrics] )) || +_vboxmanage_metrics() { + local ret=1 + + _arguments -C \ + '1: :(collect disable enable list query setup)' \ + '*:: :->arg' \ + && ret=0 + + case $state in + (arg) + case $words[1] in + (collect) + _arguments \ + '--detach[Disables the collection of metric data, so no data is output]' \ + '--list[Shows which metrics match the specified filter]' \ + '--period=[Specifies the number of seconds to wait between collecting metric data samples]:sec' \ + '--samples=[Specifies the number of metric data samples to save]' \ + '1: :_vboxmachines' \ + && ret=0 + ;; + (disable) + _arguments \ + '--list[Shows which metrics match the specified filter]' \ + '1: :_vboxmachines' \ + && ret=0 + ;; + (setup) + _arguments \ + '--list[Shows which metrics match the specified filter]' \ + '--period=[Specifies the number of seconds to wait between collecting metric data samples]:sec' \ + '--samples=[Specifies the number of metric data samples to save]' \ + '1: :_vboxmachines' \ + && ret=0 + ;; + (*) + _arguments \ + '1: :_vboxmachines' \ + && ret=0 + ;; + esac + ;; + esac + + return $ret +} + (( $+functions[_vboxmanage_natnetwork] )) || _vboxmanage_natnetwork() { local ret=1 |
