diff options
| author | Massimiliano Torromeo <massimiliano.torromeo@gmail.com> | 2017-05-07 22:12:08 +0200 |
|---|---|---|
| committer | Massimiliano Torromeo <massimiliano.torromeo@gmail.com> | 2017-05-07 22:15:24 +0200 |
| commit | f9d7d9de78e368f346c91b769daeb7b8f027f4d1 (patch) | |
| tree | 0ae573e2113f43bc05c4be5fa7e36b84fca49037 /src/_rkt | |
| parent | Merge pull request #496 from patrick96/gist-read (diff) | |
| download | zsh-completions-f9d7d9de78e368f346c91b769daeb7b8f027f4d1.tar zsh-completions-f9d7d9de78e368f346c91b769daeb7b8f027f4d1.tar.gz zsh-completions-f9d7d9de78e368f346c91b769daeb7b8f027f4d1.tar.bz2 zsh-completions-f9d7d9de78e368f346c91b769daeb7b8f027f4d1.tar.lz zsh-completions-f9d7d9de78e368f346c91b769daeb7b8f027f4d1.tar.xz zsh-completions-f9d7d9de78e368f346c91b769daeb7b8f027f4d1.tar.zst zsh-completions-f9d7d9de78e368f346c91b769daeb7b8f027f4d1.zip | |
Implemented autocompletion for rkt pods and images (Fixes #465)
Diffstat (limited to 'src/_rkt')
| -rw-r--r-- | src/_rkt | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -68,6 +68,8 @@ _rkt() { cat-manifest) _arguments \ '--pretty-print[apply indent to format the output]' \ + '--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \ + '1:POD:_rkt_pods' \ ;; config) @@ -78,12 +80,15 @@ _rkt() { enter) _arguments \ '--app=:appname' \ + '1:POD:_rkt_pods' \ ;; export) _arguments \ '--app=:appname' \ '--overwrite[overwrite output ACI]' \ + '1:POD:_rkt_pods' \ + '2:OUTPUT_ACI_FILE:_files' \ ;; fetch) @@ -138,11 +143,13 @@ _rkt() { '--stage1-url=[a URL to an image to use as stage1]:image url' \ '--store-only[use only available images in the store]' \ '--volume=[volumes to make available in the pod]:volume' \ + '1:IMAGE:_rkt_images' \ ;; rm) _arguments \ '--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \ + '1:POD:_rkt_pods' \ ;; run) @@ -173,6 +180,7 @@ _rkt() { '--store-only[use only available images in the store]' \ '--uuid-file-save=[write out pod UUID to specified file]:uuid file:_files' \ '--volume=[volumes to make available in the pod]:volume' \ + '1:IMAGE:_rkt_images' \ ;; run-prepared) @@ -184,11 +192,13 @@ _rkt() { '--interactive[run pod interactively]' \ '--mds-register[register pod with metadata service]' \ "--net=[configure the pod's networking]:networks" \ + '1:POD:_rkt_pods' \ ;; status) _arguments \ '--wait[toggle waiting for the pod to exit]' \ + '1:POD:_rkt_pods' \ ;; trust) @@ -217,6 +227,7 @@ _rkt() { cat-manifest) _arguments \ '--pretty-print[apply indent to format the output]' \ + '1:IMAGE:_rkt_images' \ ;; gc) @@ -233,7 +244,7 @@ _rkt() { rm) _arguments \ - ':image' \ + '*:IMAGE:_rkt_images' \ ;; esac ;; @@ -276,6 +287,19 @@ _rkt_image_cmds() { _describe 'command' commands } +_rkt_images() { + local -a images + images=($(rkt image list --fields id,name --no-legend | sed 's/\t/\n/;s/:/\\:/g' | sort | uniq)) + _describe 'IMAGE' images +} + +_rkt_pods() { + local -a pods + IFS=$'\n' + pods=($(rkt list --full --no-legend | sed 's/:/\\:/g;s/\t/:/;s/\t/ /g')) + _describe 'POD' pods +} + _rkt "$@" # Local Variables: |
