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
;;
(ls|list)
words[1]='images'
__docker_subcommand && ret=0
local state
_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)
# @TODO
@ -2093,21 +2106,8 @@ __docker_subcommand() {
esac
;;
(images)
_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
words[1]='ls'
__docker_image_subcommand && ret=0
;;
(import)
__docker_image_subcommand && ret=0