From abc793e3331336183fe9ea8e3c462ec11a9f4ca7 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Wed, 26 Jul 2017 13:06:22 +0200 Subject: [PATCH] Add file completion to bash completion for `secret create` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 66174729d0..e8939e0967 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1184,7 +1184,7 @@ _docker_config_create() { ;; *) local counter=$(__docker_pos_first_nonflag '--label|-l') - if [ "$cword" -eq $((counter + 1)) ]; then + if [ "$cword" -eq "$((counter + 1))" ]; then _filedir fi ;; @@ -4159,6 +4159,12 @@ _docker_secret_create() { -*) COMPREPLY=( $( compgen -W "--help --label -l" -- "$cur" ) ) ;; + *) + local counter=$(__docker_pos_first_nonflag '--label|-l') + if [ "$cword" -eq "$((counter + 1))" ]; then + _filedir + fi + ;; esac }