Implemented autocompletion for rkt pods and images (Fixes #465)
This commit is contained in:
parent
fa1c720584
commit
f9d7d9de78
26
src/_rkt
26
src/_rkt
|
@ -68,6 +68,8 @@ _rkt() {
|
||||||
cat-manifest)
|
cat-manifest)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--pretty-print[apply indent to format the output]' \
|
'--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)
|
config)
|
||||||
|
@ -78,12 +80,15 @@ _rkt() {
|
||||||
enter)
|
enter)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--app=:appname' \
|
'--app=:appname' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
export)
|
export)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--app=:appname' \
|
'--app=:appname' \
|
||||||
'--overwrite[overwrite output ACI]' \
|
'--overwrite[overwrite output ACI]' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
|
'2:OUTPUT_ACI_FILE:_files' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
fetch)
|
fetch)
|
||||||
|
@ -138,11 +143,13 @@ _rkt() {
|
||||||
'--stage1-url=[a URL to an image to use as stage1]:image url' \
|
'--stage1-url=[a URL to an image to use as stage1]:image url' \
|
||||||
'--store-only[use only available images in the store]' \
|
'--store-only[use only available images in the store]' \
|
||||||
'--volume=[volumes to make available in the pod]:volume' \
|
'--volume=[volumes to make available in the pod]:volume' \
|
||||||
|
'1:IMAGE:_rkt_images' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
rm)
|
rm)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
|
'--uuid-file=[read pod UUID from file instead of argument]:uuid file:_files' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
run)
|
run)
|
||||||
|
@ -173,6 +180,7 @@ _rkt() {
|
||||||
'--store-only[use only available images in the store]' \
|
'--store-only[use only available images in the store]' \
|
||||||
'--uuid-file-save=[write out pod UUID to specified file]:uuid file:_files' \
|
'--uuid-file-save=[write out pod UUID to specified file]:uuid file:_files' \
|
||||||
'--volume=[volumes to make available in the pod]:volume' \
|
'--volume=[volumes to make available in the pod]:volume' \
|
||||||
|
'1:IMAGE:_rkt_images' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
run-prepared)
|
run-prepared)
|
||||||
|
@ -184,11 +192,13 @@ _rkt() {
|
||||||
'--interactive[run pod interactively]' \
|
'--interactive[run pod interactively]' \
|
||||||
'--mds-register[register pod with metadata service]' \
|
'--mds-register[register pod with metadata service]' \
|
||||||
"--net=[configure the pod's networking]:networks" \
|
"--net=[configure the pod's networking]:networks" \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
status)
|
status)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--wait[toggle waiting for the pod to exit]' \
|
'--wait[toggle waiting for the pod to exit]' \
|
||||||
|
'1:POD:_rkt_pods' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
trust)
|
trust)
|
||||||
|
@ -217,6 +227,7 @@ _rkt() {
|
||||||
cat-manifest)
|
cat-manifest)
|
||||||
_arguments \
|
_arguments \
|
||||||
'--pretty-print[apply indent to format the output]' \
|
'--pretty-print[apply indent to format the output]' \
|
||||||
|
'1:IMAGE:_rkt_images' \
|
||||||
;;
|
;;
|
||||||
|
|
||||||
gc)
|
gc)
|
||||||
|
@ -233,7 +244,7 @@ _rkt() {
|
||||||
|
|
||||||
rm)
|
rm)
|
||||||
_arguments \
|
_arguments \
|
||||||
':image' \
|
'*:IMAGE:_rkt_images' \
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
@ -276,6 +287,19 @@ _rkt_image_cmds() {
|
||||||
_describe 'command' commands
|
_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 "$@"
|
_rkt "$@"
|
||||||
|
|
||||||
# Local Variables:
|
# Local Variables:
|
||||||
|
|
Loading…
Reference in New Issue