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