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
parent df486631bc
commit 6864f3ae5a

View file

@ -2148,7 +2148,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() {
@ -3005,25 +3023,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() {