Move bash completion logic to new subcommand: tag

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2016-10-24 09:32:16 -07:00 committed by Tibor Vass
parent 54bb65787c
commit 398d4706d3
1 changed files with 20 additions and 20 deletions

View File

@ -2226,7 +2226,25 @@ _docker_image_save() {
}
_docker_image_tag() {
_docker_tag
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_complete_image_repos_and_tags
return
fi
(( counter++ ))
if [ $cword -eq $counter ]; then
__docker_complete_image_repos_and_tags
return
fi
;;
esac
}
@ -3134,25 +3152,7 @@ _docker_stop() {
}
_docker_tag() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
__docker_complete_image_repos_and_tags
return
fi
(( counter++ ))
if [ $cword -eq $counter ]; then
__docker_complete_image_repos_and_tags
return
fi
;;
esac
_docker_image_tag
}
_docker_unpause() {