From 70d8efd00120f8be9cef95764a6c80c38a3af285 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Sat, 31 Dec 2016 09:23:27 -0800 Subject: [PATCH] Fix bash completion for `plugin enable|disable` `docker plugin enable` and `docker plugin disable` only accept one plugin. Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 1b87a18e08..2c4e2792f2 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -3222,7 +3222,10 @@ _docker_plugin_disable() { COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) ;; *) - __docker_complete_plugins_installed + local counter=$(__docker_pos_first_nonflag) + if [ $cword -eq $counter ]; then + __docker_complete_plugins_installed + fi ;; esac } @@ -3239,7 +3242,10 @@ _docker_plugin_enable() { COMPREPLY=( $( compgen -W "--help --timeout" -- "$cur" ) ) ;; *) - __docker_complete_plugins_installed + local counter=$(__docker_pos_first_nonflag '--timeout') + if [ $cword -eq $counter ]; then + __docker_complete_plugins_installed + fi ;; esac }