Move zsh completion logic to new subcommand: ls

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
This commit is contained in:
Steve Durrheimer 2016-10-30 21:55:27 +01:00 committed by Tibor Vass
parent e21d331b1e
commit 47364fcb71
1 changed files with 17 additions and 17 deletions

View File

@ -953,8 +953,21 @@ __docker_image_subcommand() {
"($help -q --quiet)"{-q,--quiet}"[Suppress the load output]" && ret=0 "($help -q --quiet)"{-q,--quiet}"[Suppress the load output]" && ret=0
;; ;;
(ls|list) (ls|list)
words[1]='images' local state
__docker_subcommand && ret=0 _arguments $(__docker_arguments) \
$opts_help \
"($help -a --all)"{-a,--all}"[Show all images]" \
"($help)--digests[Show digests]" \
"($help)*"{-f=,--filter=}"[Filter values]:filter:->filter-options" \
"($help)--format=[Pretty-print images using a Go template]:template: " \
"($help)--no-trunc[Do not truncate output]" \
"($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
"($help -): :__docker_complete_repositories" && ret=0
case $state in
(filter-options)
__docker_complete_images_filters && ret=0
;;
esac
;; ;;
(prune) (prune)
# @TODO # @TODO
@ -2093,21 +2106,8 @@ __docker_subcommand() {
esac esac
;; ;;
(images) (images)
_arguments $(__docker_arguments) \ words[1]='ls'
$opts_help \ __docker_image_subcommand && ret=0
"($help -a --all)"{-a,--all}"[Show all images]" \
"($help)--digests[Show digests]" \
"($help)*"{-f=,--filter=}"[Filter values]:filter:->filter-options" \
"($help)--format=[Pretty-print images using a Go template]:template: " \
"($help)--no-trunc[Do not truncate output]" \
"($help -q --quiet)"{-q,--quiet}"[Only show numeric IDs]" \
"($help -): :__docker_complete_repositories" && ret=0
case $state in
(filter-options)
__docker_complete_images_filters && ret=0
;;
esac
;; ;;
(import) (import)
__docker_image_subcommand && ret=0 __docker_image_subcommand && ret=0