Fix bash completion for service env, mounts and labels

`service create` and `service update` both used to have `--env`, `--label`
and `--mount` options.
These options now are only valid for `service create`.
`service update` got corresponding `--xxx-add|rm` options instead.

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2017-11-10 10:03:30 +01:00
parent 69b11daa77
commit d149c93c0c
1 changed files with 14 additions and 4 deletions

View File

@ -3333,7 +3333,6 @@ _docker_service_update_and_create() {
local options_with_args=" local options_with_args="
--endpoint-mode --endpoint-mode
--entrypoint --entrypoint
--env -e
--force --force
--health-cmd --health-cmd
--health-interval --health-interval
@ -3342,12 +3341,10 @@ _docker_service_update_and_create() {
--health-timeout --health-timeout
--hostname --hostname
--isolation --isolation
--label -l
--limit-cpu --limit-cpu
--limit-memory --limit-memory
--log-driver --log-driver
--log-opt --log-opt
--mount
--replicas --replicas
--reserve-cpu --reserve-cpu
--reserve-memory --reserve-memory
@ -3395,11 +3392,14 @@ _docker_service_update_and_create() {
--dns --dns
--dns-option --dns-option
--dns-search --dns-search
--env -e
--env-file --env-file
--generic-resource --generic-resource
--group --group
--host --host
--label -l
--mode --mode
--mount
--name --name
--network --network
--placement-pref --placement-pref
@ -3458,6 +3458,8 @@ _docker_service_update_and_create() {
--dns-rm --dns-rm
--dns-search-add --dns-search-add
--dns-search-rm --dns-search-rm
--env-add
--env-rm
--generic-resource-add --generic-resource-add
--generic-resource-rm --generic-resource-rm
--group-add --group-add
@ -3465,6 +3467,10 @@ _docker_service_update_and_create() {
--host-add --host-add
--host-rm --host-rm
--image --image
--label-add
--label-rm
--mount-add
--mount-rm
--network-add --network-add
--network-rm --network-rm
--placement-pref-add --placement-pref-add
@ -3481,6 +3487,10 @@ _docker_service_update_and_create() {
__docker_complete_configs __docker_complete_configs
return return
;; ;;
--env-rm)
COMPREPLY=( $( compgen -e -- "$cur" ) )
return
;;
--group-add|--group-rm) --group-add|--group-rm)
COMPREPLY=( $(compgen -g -- "$cur") ) COMPREPLY=( $(compgen -g -- "$cur") )
return return
@ -3527,7 +3537,7 @@ _docker_service_update_and_create() {
COMPREPLY=( $( compgen -W "dnsrr vip" -- "$cur" ) ) COMPREPLY=( $( compgen -W "dnsrr vip" -- "$cur" ) )
return return
;; ;;
--env|-e) --env|-e|--env-add)
# we do not append a "=" here because "-e VARNAME" is legal systax, too # we do not append a "=" here because "-e VARNAME" is legal systax, too
COMPREPLY=( $( compgen -e -- "$cur" ) ) COMPREPLY=( $( compgen -e -- "$cur" ) )
__docker_nospace __docker_nospace