Parcourir la source

Fix bash completion for `docker service create|update

Signed-off-by: Harald Albers <github@albersweb.de>
Harald Albers il y a 8 ans
Parent
commit
be5685e4bf
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. 9 1
      contrib/completion/bash/docker

+ 9 - 1
contrib/completion/bash/docker

@@ -2846,9 +2846,17 @@ _docker_service_update() {
 			COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
 			COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
 			;;
 			;;
 		*)
 		*)
+			local counter=$( __docker_pos_first_nonflag $( __docker_to_alternatives "$options_with_args" ) )
 			if [ "$subcommand" = "update" ] ; then
 			if [ "$subcommand" = "update" ] ; then
-				__docker_complete_services
+				if [ $cword -eq $counter ]; then
+					__docker_complete_services
+				fi
+			else
+				if [ $cword -eq $counter ]; then
+					__docker_complete_images
+				fi
 			fi
 			fi
+			;;
 	esac
 	esac
 }
 }