bash completion for default port on `docker swarm {init,join}`

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2016-06-29 05:26:55 -07:00 committed by Tibor Vass
parent 14f578eb92
commit 2082c976e8
1 changed files with 17 additions and 2 deletions

View File

@ -1816,7 +1816,13 @@ _docker_swarm_init() {
COMPREPLY=( $( compgen -W "manager none worker" -- "$cur" ) ) COMPREPLY=( $( compgen -W "manager none worker" -- "$cur" ) )
return return
;; ;;
--listen-addr|--secret) --listen-addr)
if [[ $cur == *: ]] ; then
COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )
fi
return
;;
--secret)
return return
;; ;;
esac esac
@ -1844,7 +1850,13 @@ _docker_swarm_inspect() {
_docker_swarm_join() { _docker_swarm_join() {
case "$prev" in case "$prev" in
--ca-hash|--listen-addr|--secret) --ca-hash|--secret)
return
;;
--listen-addr)
if [[ $cur == *: ]] ; then
COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )
fi
return return
;; ;;
esac esac
@ -1853,6 +1865,9 @@ _docker_swarm_join() {
-*) -*)
COMPREPLY=( $( compgen -W "--ca-hash --help --listen-addr --manager --secret" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--ca-hash --help --listen-addr --manager --secret" -- "$cur" ) )
;; ;;
*:)
COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )
;;
esac esac
} }