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

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
This commit is contained in:
Steve Durrheimer 2016-07-20 09:18:59 +02:00 committed by Tibor Vass
parent 59b234a119
commit ddd049d51a
1 changed files with 12 additions and 2 deletions

View File

@ -242,6 +242,14 @@ __docker_get_log_options() {
return ret 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() { __docker_log_options() {
[[ $PREFIX = -* ]] && return 1 [[ $PREFIX = -* ]] && return 1
integer ret=1 integer ret=1
@ -1071,6 +1079,8 @@ __docker_service_subcommand() {
"($help)*--label=[Service labels]:label: " "($help)*--label=[Service labels]:label: "
"($help)--limit-cpu=[Limit CPUs]:value: " "($help)--limit-cpu=[Limit CPUs]:value: "
"($help)--limit-memory=[Limit Memory]: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)*--mount=[Attach a mount to the service]:mount: "
"($help)--name=[Service name]:name: " "($help)--name=[Service name]:name: "
"($help)*--network=[Network attachments]:network: " "($help)*--network=[Network attachments]:network: "
@ -1429,7 +1439,7 @@ __docker_subcommand() {
"($help)*--link=[Add link to another container]:link:->link" "($help)*--link=[Add link to another container]:link:->link"
"($help)*--link-local-ip=[Add a link-local address for the container]:IPv4/IPv6: " "($help)*--link-local-ip=[Add a link-local address for the container]:IPv4/IPv6: "
"($help)*"{-l=,--label=}"[Container metadata]:label: " "($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)*--log-opt=[Log driver specific options]:log driver options:__docker_log_options"
"($help)--mac-address=[Container MAC address]:MAC address: " "($help)--mac-address=[Container MAC address]:MAC address: "
"($help)--name=[Container name]:name: " "($help)--name=[Container name]:name: "
@ -1575,7 +1585,7 @@ __docker_subcommand() {
"($help -l --log-level)"{-l=,--log-level=}"[Logging level]:level:(debug info warn error fatal)" \ "($help -l --log-level)"{-l=,--log-level=}"[Logging level]:level:(debug info warn error fatal)" \
"($help)*--label=[Key=value labels]:label: " \ "($help)*--label=[Key=value labels]:label: " \
"($help)--live-restore[Enable live restore of docker when containers are still running]" \ "($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)*--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-downloads[Set the max concurrent downloads for each pull]" \
"($help)--max-concurrent-uploads[Set the max concurrent uploads for each push]" \ "($help)--max-concurrent-uploads[Set the max concurrent uploads for each push]" \