mirror of
https://github.com/docker/compose.git
synced 2025-07-23 13:45:00 +02:00
zsh autocomplete: break out duplicated flag messages into variables
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
This commit is contained in:
parent
0058b4ba0c
commit
b3d4e9c9d7
@ -182,7 +182,17 @@ __docker-compose_commands() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__docker-compose_subcommand() {
|
__docker-compose_subcommand() {
|
||||||
local opts_help='(: -)--help[Print usage]'
|
local opts_help opts_force_recreate opts_no_recreate opts_no_build opts_remove_orphans opts_timeout opts_no_color opts_no_deps
|
||||||
|
|
||||||
|
opts_help='(: -)--help[Print usage]'
|
||||||
|
opts_force_recreate="(--no-recreate)--force-recreate[Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.]"
|
||||||
|
opts_no_recreate="(--force-recreate)--no-recreate[If containers already exist, don't recreate them. Incompatible with --force-recreate.]"
|
||||||
|
opts_no_build="(--build)--no-build[Don't build an image, even if it's missing.]"
|
||||||
|
opts_remove_orphans="--remove-orphans[Remove containers for services not defined in the Compose file]"
|
||||||
|
opts_timeout=('(-t --timeout)'{-t,--timeout}"[Specify a shutdown timeout in seconds. (default: 10)]:seconds: ")
|
||||||
|
opts_no_color='--no-color[Produce monochrome output.]'
|
||||||
|
opts_no_deps="--no-deps[Don't start linked services.]"
|
||||||
|
|
||||||
integer ret=1
|
integer ret=1
|
||||||
|
|
||||||
case "$words[1]" in
|
case "$words[1]" in
|
||||||
@ -203,9 +213,9 @@ __docker-compose_subcommand() {
|
|||||||
(create)
|
(create)
|
||||||
_arguments \
|
_arguments \
|
||||||
$opts_help \
|
$opts_help \
|
||||||
"(--no-recreate)--force-recreate[Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.]" \
|
$opts_force_recreate \
|
||||||
"(--force-recreate)--no-recreate[If containers already exist, don't recreate them. Incompatible with --force-recreate.]" \
|
$opts_no_recreate \
|
||||||
"(--build)--no-build[Don't build an image, even if it's missing.]" \
|
$opts_no_build \
|
||||||
"(--no-build)--build[Build images before creating containers.]" \
|
"(--no-build)--build[Build images before creating containers.]" \
|
||||||
'*:services:__docker-compose_services_all' && ret=0
|
'*:services:__docker-compose_services_all' && ret=0
|
||||||
;;
|
;;
|
||||||
@ -214,7 +224,7 @@ __docker-compose_subcommand() {
|
|||||||
$opts_help \
|
$opts_help \
|
||||||
"--rmi[Remove images. Type must be one of: 'all': Remove all images used by any service. 'local': Remove only images that don't have a custom tag set by the \`image\` field.]:type:(all local)" \
|
"--rmi[Remove images. Type must be one of: 'all': Remove all images used by any service. 'local': Remove only images that don't have a custom tag set by the \`image\` field.]:type:(all local)" \
|
||||||
'(-v --volumes)'{-v,--volumes}"[Remove named volumes declared in the \`volumes\` section of the Compose file and anonymous volumes attached to containers.]" \
|
'(-v --volumes)'{-v,--volumes}"[Remove named volumes declared in the \`volumes\` section of the Compose file and anonymous volumes attached to containers.]" \
|
||||||
'--remove-orphans[Remove containers for services not defined in the Compose file]' && ret=0
|
$opts_remove_orphans && ret=0
|
||||||
;;
|
;;
|
||||||
(events)
|
(events)
|
||||||
_arguments \
|
_arguments \
|
||||||
@ -247,7 +257,7 @@ __docker-compose_subcommand() {
|
|||||||
_arguments \
|
_arguments \
|
||||||
$opts_help \
|
$opts_help \
|
||||||
'(-f --follow)'{-f,--follow}'[Follow log output]' \
|
'(-f --follow)'{-f,--follow}'[Follow log output]' \
|
||||||
'--no-color[Produce monochrome output.]' \
|
$opts_no_color \
|
||||||
'--tail=[Number of lines to show from the end of the logs for each container.]:number of lines: ' \
|
'--tail=[Number of lines to show from the end of the logs for each container.]:number of lines: ' \
|
||||||
'(-t --timestamps)'{-t,--timestamps}'[Show timestamps]' \
|
'(-t --timestamps)'{-t,--timestamps}'[Show timestamps]' \
|
||||||
'*:services:__docker-compose_services_all' && ret=0
|
'*:services:__docker-compose_services_all' && ret=0
|
||||||
@ -291,7 +301,7 @@ __docker-compose_subcommand() {
|
|||||||
'*-e[KEY=VAL Set an environment variable (can be used multiple times)]:environment variable KEY=VAL: ' \
|
'*-e[KEY=VAL Set an environment variable (can be used multiple times)]:environment variable KEY=VAL: ' \
|
||||||
'--entrypoint[Overwrite the entrypoint of the image.]:entry point: ' \
|
'--entrypoint[Overwrite the entrypoint of the image.]:entry point: ' \
|
||||||
'--name=[Assign a name to the container]:name: ' \
|
'--name=[Assign a name to the container]:name: ' \
|
||||||
"--no-deps[Don't start linked services.]" \
|
$opts_no_deps \
|
||||||
'(-p --publish)'{-p,--publish=}"[Publish a container's port(s) to the host]" \
|
'(-p --publish)'{-p,--publish=}"[Publish a container's port(s) to the host]" \
|
||||||
'--rm[Remove container after run. Ignored in detached mode.]' \
|
'--rm[Remove container after run. Ignored in detached mode.]' \
|
||||||
"--service-ports[Run command with the service's ports enabled and mapped to the host.]" \
|
"--service-ports[Run command with the service's ports enabled and mapped to the host.]" \
|
||||||
@ -305,7 +315,7 @@ __docker-compose_subcommand() {
|
|||||||
(scale)
|
(scale)
|
||||||
_arguments \
|
_arguments \
|
||||||
$opts_help \
|
$opts_help \
|
||||||
'(-t --timeout)'{-t,--timeout}"[Specify a shutdown timeout in seconds. (default: 10)]:seconds: " \
|
$opts_timeout \
|
||||||
'*:running services:__docker-compose_runningservices' && ret=0
|
'*:running services:__docker-compose_runningservices' && ret=0
|
||||||
;;
|
;;
|
||||||
(start)
|
(start)
|
||||||
@ -316,7 +326,7 @@ __docker-compose_subcommand() {
|
|||||||
(stop|restart)
|
(stop|restart)
|
||||||
_arguments \
|
_arguments \
|
||||||
$opts_help \
|
$opts_help \
|
||||||
'(-t --timeout)'{-t,--timeout}"[Specify a shutdown timeout in seconds. (default: 10)]:seconds: " \
|
$opts_timeout \
|
||||||
'*:running services:__docker-compose_runningservices' && ret=0
|
'*:running services:__docker-compose_runningservices' && ret=0
|
||||||
;;
|
;;
|
||||||
(unpause)
|
(unpause)
|
||||||
@ -328,15 +338,15 @@ __docker-compose_subcommand() {
|
|||||||
_arguments \
|
_arguments \
|
||||||
$opts_help \
|
$opts_help \
|
||||||
'(--abort-on-container-exit)-d[Detached mode: Run containers in the background, print new container names. Incompatible with --abort-on-container-exit.]' \
|
'(--abort-on-container-exit)-d[Detached mode: Run containers in the background, print new container names. Incompatible with --abort-on-container-exit.]' \
|
||||||
'--no-color[Produce monochrome output.]' \
|
$opts_no_color \
|
||||||
"--no-deps[Don't start linked services.]" \
|
$opts_no_deps \
|
||||||
"(--no-recreate)--force-recreate[Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.]" \
|
$opts_force_recreate \
|
||||||
"(--force-recreate)--no-recreate[If containers already exist, don't recreate them. Incompatible with --force-recreate.]" \
|
$opts_no_recreate \
|
||||||
"(--build)--no-build[Don't build an image, even if it's missing.]" \
|
$opts_no_build \
|
||||||
"(--no-build)--build[Build images before starting containers.]" \
|
"(--no-build)--build[Build images before starting containers.]" \
|
||||||
"(-d)--abort-on-container-exit[Stops all containers if any container was stopped. Incompatible with -d.]" \
|
"(-d)--abort-on-container-exit[Stops all containers if any container was stopped. Incompatible with -d.]" \
|
||||||
'(-t --timeout)'{-t,--timeout}"[Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)]:seconds: " \
|
'(-t --timeout)'{-t,--timeout}"[Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)]:seconds: " \
|
||||||
"--remove-orphans[Remove containers for services not defined in the Compose file]" \
|
$opts_remove_orphans \
|
||||||
'*:services:__docker-compose_services_all' && ret=0
|
'*:services:__docker-compose_services_all' && ret=0
|
||||||
;;
|
;;
|
||||||
(version)
|
(version)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user