From 00d3727106ef4d1280175a135b36b80c8bfc6a7b Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Fri, 6 Mar 2015 15:13:27 +0800 Subject: [PATCH] Fix docker build and docker run bash completion Signed-off-by: Lei Jitang --- contrib/completion/bash/docker | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index cd09e4ba62..01140d8c7d 100755 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -255,11 +255,15 @@ _docker_build() { __docker_image_repos_and_tags return ;; + --file|-f) + _filedir + return + ;; esac case "$cur" in -*) - COMPREPLY=( $( compgen -W "--force-rm --no-cache --quiet -q --rm --tag -t" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--file -f --force-rm --no-cache --quiet -q --rm --tag -t" -- "$cur" ) ) ;; *) local counter="$(__docker_pos_first_nonflag '--tag|-t')" @@ -623,8 +627,10 @@ _docker_run() { --lxc-conf --mac-address --memory -m + --memory-swap --name --net + --pid --publish -p --restart --security-opt @@ -635,9 +641,11 @@ _docker_run() { " local all_options="$options_with_args + --help --interactive -i --privileged --publish-all -P + --read-only --tty -t "