Move bash completion logic to new subcommand: pull

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2016-10-24 09:26:40 -07:00 committed by Tibor Vass
parent ff05fa31d5
commit 3ed53e5641
1 changed files with 20 additions and 20 deletions

View File

@ -2153,7 +2153,25 @@ _docker_image_prune() {
}
_docker_image_pull() {
_docker_pull
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--all-tags -a --disable-content-trust=false --help" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
for arg in "${COMP_WORDS[@]}"; do
case "$arg" in
--all-tags|-a)
__docker_complete_image_repos
return
;;
esac
done
__docker_complete_image_repos_and_tags
fi
;;
esac
}
_docker_image_push() {
@ -3010,25 +3028,7 @@ _docker_ps() {
}
_docker_pull() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--all-tags -a --disable-content-trust=false --help" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
if [ $cword -eq $counter ]; then
for arg in "${COMP_WORDS[@]}"; do
case "$arg" in
--all-tags|-a)
__docker_complete_image_repos
return
;;
esac
done
__docker_complete_image_repos_and_tags
fi
;;
esac
_docker_image_pull
}
_docker_push() {