Move bash completion logic to new subcommand: pull
@@ -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() {
