Add missing options to bash completion

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2014-12-29 19:21:45 +01:00 committed by Tibor Vass
parent 6345932ff1
commit 1d3be0eae9
1 changed files with 45 additions and 6 deletions

View File

@ -368,7 +368,18 @@ _docker_kill() {
} }
_docker_load() { _docker_load() {
case "$prev" in
-i|--input)
_filedir
return return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-i --input" -- "$cur" ) )
;;
esac
} }
_docker_login() { _docker_login() {
@ -516,9 +527,11 @@ _docker_run() {
--env-file --env-file
--expose --expose
-h --hostname -h --hostname
--ipc
--link --link
--lxc-conf --lxc-conf
-m --memory -m --memory
--mac-address
--name --name
--net --net
-p --publish -p --publish
@ -577,6 +590,21 @@ _docker_run() {
compopt -o nospace compopt -o nospace
return return
;; ;;
--ipc)
case "$cur" in
*:*)
cur="${cur#*:}"
__docker_containers_running
;;
*)
COMPREPLY=( $( compgen -W 'host container:' -- "$cur" ) )
if [ "$COMPREPLY" = "container:" ]; then
compopt -o nospace
fi
;;
esac
return
;;
--link) --link)
case "$cur" in case "$cur" in
*:*) *:*)
@ -644,7 +672,7 @@ _docker_run() {
esac esac
return return
;; ;;
--entrypoint|-h|--hostname|-m|--memory|-u|--user|-w|--workdir|--cpuset|-c|--cpu-shares|-n|--name|-p|--publish|--expose|--dns|--lxc-conf|--dns-search) --entrypoint|-h|--hostname|--mac-address|-m|--memory|-u|--user|-w|--workdir|--cpuset|-c|--cpu-shares|-n|--name|-p|--publish|--expose|--dns|--lxc-conf|--dns-search)
return return
;; ;;
esac esac
@ -664,10 +692,21 @@ _docker_run() {
} }
_docker_save() { _docker_save() {
local counter=$(__docker_pos_first_nonflag) case "$prev" in
if [ $cword -eq $counter ]; then -o|--output)
_filedir
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "-o --output" -- "$cur" ) )
;;
*)
__docker_image_repos_and_tags_and_ids __docker_image_repos_and_tags_and_ids
fi ;;
esac
} }
_docker_search() { _docker_search() {