Skip to content

Commit

Permalink
Update bash completion for `docker service {create,update} {--mode,--…
Browse files Browse the repository at this point in the history
…endpoint-mode}`

Signed-off-by: Harald Albers <[email protected]>
(cherry picked from commit a394490)
Signed-off-by: Tibor Vass <[email protected]>
  • Loading branch information
albers authored and Tibor Vass committed Jul 26, 2016
1 parent fc4c8d9 commit 9b0ebd2
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,6 @@ _docker_service_update() {
--label -l
--limit-cpu
--limit-memory
--mode
--mount -m
--name
--network
Expand All @@ -1734,6 +1733,18 @@ _docker_service_update() {
--registry-auth
"

if [ "$subcommand" = "create" ] ; then
options_with_args="$options_with_args
--mode
"

case "$prev" in
--mode)
COMPREPLY=( $( compgen -W "global replicated" -- "$cur" ) )
return
;;
esac
fi
if [ "$subcommand" = "update" ] ; then
options_with_args="$options_with_args
--arg
Expand All @@ -1751,18 +1762,14 @@ _docker_service_update() {

case "$prev" in
--endpoint-mode)
COMPREPLY=( $( compgen -W "DNSRR VIP" -- "$cur" ) )
COMPREPLY=( $( compgen -W "dnsrr vip" -- "$cur" ) )
return
;;
--env|-e)
COMPREPLY=( $( compgen -e -S = -- "$cur" ) )
__docker_nospace
return
;;
--mode)
COMPREPLY=( $( compgen -W "global replicated" -- "$cur" ) )
return
;;
--network)
__docker_complete_networks
return
Expand Down

0 comments on commit 9b0ebd2

Please sign in to comment.