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

Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 009d50e2d8)
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Harald Albers 2016-06-29 05:26:55 -07:00 committed by Tibor Vass
parent 00a988c2ad
commit d8d1573b0d

View file

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