Add zsh completion for 'docker service {create,update} --log-{driver,opt}'

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
(cherry picked from commit 45484f5458)
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Steve Durrheimer 2016-07-20 09:18:59 +02:00 committed by Tibor Vass
parent 05e6d5f5db
commit b29a9fdc4b

View file

@ -242,6 +242,14 @@ __docker_get_log_options() {
return ret
}
__docker_log_drivers() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
drivers=(awslogs etwlogs fluentd gcplogs gelf journald json-file none splunk syslog)
_describe -t log-drivers "log drivers" drivers && ret=0
return ret
}
__docker_log_options() {
[[ $PREFIX = -* ]] && return 1
integer ret=1
@ -1072,6 +1080,8 @@ __docker_service_subcommand() {
"($help)*--label=[Service labels]:label: "
"($help)--limit-cpu=[Limit CPUs]:value: "
"($help)--limit-memory=[Limit Memory]:value: "
"($help)--log-driver=[Logging driver for service]:logging driver:__docker_log_drivers"
"($help)*--log-opt=[Logging driver options]:log driver options:__docker_log_options"
"($help)*--mount=[Attach a mount to the service]:mount: "
"($help)--name=[Service name]:name: "
"($help)*--network=[Network attachments]:network: "
@ -1430,7 +1440,7 @@ __docker_subcommand() {
"($help)*--link=[Add link to another container]:link:->link"
"($help)*--link-local-ip=[Add a link-local address for the container]:IPv4/IPv6: "
"($help)*"{-l=,--label=}"[Container metadata]:label: "
"($help)--log-driver=[Default driver for container logs]:Logging driver:(awslogs etwlogs fluentd gcplogs gelf journald json-file none splunk syslog)"
"($help)--log-driver=[Default driver for container logs]:logging driver:__docker_log_drivers"
"($help)*--log-opt=[Log driver specific options]:log driver options:__docker_log_options"
"($help)--mac-address=[Container MAC address]:MAC address: "
"($help)--name=[Container name]:name: "
@ -1576,7 +1586,7 @@ __docker_subcommand() {
"($help -l --log-level)"{-l=,--log-level=}"[Logging level]:level:(debug info warn error fatal)" \
"($help)*--label=[Key=value labels]:label: " \
"($help)--live-restore[Enable live restore of docker when containers are still running]" \
"($help)--log-driver=[Default driver for container logs]:Logging driver:(awslogs etwlogs fluentd gcplogs gelf journald json-file none splunk syslog)" \
"($help)--log-driver=[Default driver for container logs]:logging driver:__docker_log_drivers" \
"($help)*--log-opt=[Default log driver options for containers]:log driver options:__docker_log_options" \
"($help)--max-concurrent-downloads[Set the max concurrent downloads for each pull]" \
"($help)--max-concurrent-uploads[Set the max concurrent uploads for each push]" \