Fix docker build and docker run bash completion

Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
Lei Jitang 2015-03-06 15:13:27 +08:00 committed by Tibor Vass
parent 93b07b4a63
commit 5bc113a640
1 changed files with 9 additions and 1 deletions

View File

@ -255,11 +255,15 @@ _docker_build() {
__docker_image_repos_and_tags __docker_image_repos_and_tags
return return
;; ;;
--file|-f)
_filedir
return
;;
esac esac
case "$cur" in 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')" local counter="$(__docker_pos_first_nonflag '--tag|-t')"
@ -623,8 +627,10 @@ _docker_run() {
--lxc-conf --lxc-conf
--mac-address --mac-address
--memory -m --memory -m
--memory-swap
--name --name
--net --net
--pid
--publish -p --publish -p
--restart --restart
--security-opt --security-opt
@ -635,9 +641,11 @@ _docker_run() {
" "
local all_options="$options_with_args local all_options="$options_with_args
--help
--interactive -i --interactive -i
--privileged --privileged
--publish-all -P --publish-all -P
--read-only
--tty -t --tty -t
" "