From 43024e2d57d7bdd63c358ac65bc3c6d1e6a4d702 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Sat, 14 Apr 2018 14:46:19 +0200 Subject: [PATCH] Add bash completion for `secret|config create --template-driver` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index a3f1bd0db0..ca64d5396f 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1220,14 +1220,18 @@ _docker_config_create() { --label|-l) return ;; + --template-driver) + COMPREPLY=( $( compgen -W "golang" -- "$cur" ) ) + return + ;; esac case "$cur" in -*) - COMPREPLY=( $( compgen -W "--help --label -l" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--help --label -l --template-driver" -- "$cur" ) ) ;; *) - local counter=$(__docker_pos_first_nonflag '--label|-l') + local counter=$(__docker_pos_first_nonflag '--label|-l|--template-driver') if [ "$cword" -eq "$((counter + 1))" ]; then _filedir fi @@ -4238,14 +4242,18 @@ _docker_secret_create() { --driver|-d|--label|-l) return ;; + --template-driver) + COMPREPLY=( $( compgen -W "golang" -- "$cur" ) ) + return + ;; esac case "$cur" in -*) - COMPREPLY=( $( compgen -W "--driver -d --help --label -l" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--driver -d --help --label -l --template-driver" -- "$cur" ) ) ;; *) - local counter=$(__docker_pos_first_nonflag '--driver|-d|--label|-l') + local counter=$(__docker_pos_first_nonflag '--driver|-d|--label|-l|--template-driver') if [ "$cword" -eq "$((counter + 1))" ]; then _filedir fi