Skip to content

Commit

Permalink
bash completion for default port on docker swarm {init,join}
Browse files Browse the repository at this point in the history
Signed-off-by: Harald Albers <github@albersweb.de>
(cherry picked from commit 009d50e)
Signed-off-by: Tibor Vass <tibor@docker.com>
  • Loading branch information
albers authored and Tibor Vass committed Jul 8, 2016
1 parent 00a988c commit d8d1573
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -1853,6 +1865,9 @@ _docker_swarm_join() {
-*)
COMPREPLY=( $( compgen -W "--ca-hash --help --listen-addr --manager --secret" -- "$cur" ) )
;;
*:)
COMPREPLY=( $( compgen -W "2377" -- "${cur##*:}" ) )
;;
esac
}

Expand Down

0 comments on commit d8d1573

Please sign in to comment.