From 763ba5078d92b3eb3ebe3f3f464360a1ccd582f7 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Thu, 23 Jul 2015 13:52:06 +0200 Subject: [PATCH] Fix problem with = in completion of docker global options Without this fix, `docker --log-driver fluentd --log-opt fluentd-tag=b` would complete `b` to `build`. Completion of the commands has to be nailed to __docker_pos_first_nonflag Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 85959f4e77..5097cca4ce 100755 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -359,7 +359,10 @@ _docker_docker() { COMPREPLY=( $( compgen -W "$boolean_options $main_options_with_args" -- "$cur" ) ) ;; *) - COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) ) + local counter="$(__docker_pos_first_nonflag $main_options_with_args_glob)" + if [ $cword -eq $counter ]; then + COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) ) + fi ;; esac }