Commit Graph

201 Commits

Author SHA1 Message Date
Joffrey F d1a23cee85 Merge pull request #4641 from albers/completion-pull--parallel
Add bash completion for `pull --parallel`
2017-03-20 11:36:29 -07:00
Joffrey F 566cd1b1e4 Merge pull request #4640 from albers/completion-up--exit-code-from
Fix bash completion for `up --exit-code-from`
2017-03-20 11:36:07 -07:00
Harald Albers 0cf5f28f17 Add bash completion for `pull --parallel`
Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-20 16:37:41 +01:00
Harald Albers 02c294ee28 Fix bash completion for `up --exit-code-from`
`--exit-code-from` requires an argument.
Also corrected sort order.

Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-20 16:28:02 +01:00
Harald Albers 5fdbd5026a Add bash completion for `config --resolve-image-digests|--volumes"`
Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-19 08:00:35 -07:00
Joffrey F 61b4d9d001 Merge pull request #4626 from albers/completion--project-directory
Add bash completion for `--project-directory`
2017-03-16 14:58:52 -07:00
Harald Albers 6a773a018e Rename variables in bash completion
The old names were supposed to designate variables that get propagated
to the Docker daemon. This is not true for all contained options and
therefore confused me.
The new names focus on the placement after the top level command.

Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-16 16:05:19 +01:00
Harald Albers de2dd5b3d3 Add bash completion for `--project-directory`
Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-16 15:47:01 +01:00
Harald Albers 583c673c8a Add bash completion for `build --build-arg`
Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-16 11:37:06 +01:00
Harald Albers ba0468395b Add bash completion for `docker-compose rm --stop`
Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-09 10:31:29 +01:00
Joffrey F 682b5b7480 Merge pull request #4586 from albers/completion-run--volume
Add bash completion for `run --volume`
2017-03-08 14:35:20 -08:00
Harald Albers 38087a2888 Fix bash completion for `docker-compose images`
Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-08 13:07:25 -08:00
Harald Albers 0652530ee9 Add bash completion for `run --volume`
Signed-off-by: Harald Albers <github@albersweb.de>
2017-03-08 12:49:31 -08:00
Jesus Tinoco 33f510b340 3501 - Add a new command option (images)
Signed-off-by: Jesus Rodriguez Tinoco <jesus.rodriguez.tinoco@gmail.com>
2017-03-02 15:00:55 -08:00
Joffrey F 6986a994a8 Merge branch 'forward-exit' of https://github.com/TheClimateCorporation/compose into TheClimateCorporation-forward-exit
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-03-01 18:04:48 -08:00
Joffrey F 284e3cfae9 Merge pull request #4289 from allandequeiroz/master
Fixing bash path problem.
2017-03-01 17:43:22 -08:00
Joffrey F 003319da86 Merge pull request #4214 from bheesham/completion-fish
Add fish completion to contrib.
2017-03-01 17:38:34 -08:00
Nathan J. Mehl cffb76d4d9 Address comments
- set flag name to `--exit-code-from` (and rename some variable,
  function and test names to match)
- force cascade_stop to true when exit-code-from flag is set
- use lambda in filter statement
- check that selected container name is in the project before running
- remove fancy parsing of service name to container mappings: if there
  are multiple containers in a service, return the first nonzero exit
  value if any
- flake8 changes

Signed-off-by: Nathan J. Mehl <n@climate.com>
2017-02-27 09:51:03 -08:00
Nathan J. Mehl a73190e1cc Add support for returning the exit value of a specific container
Current best practice for using docker-compose as a tool for continuous
integration requires fragile shell pipelines to query the exit status
of composed containers, e.g.:

http://stackoverflow.com/questions/29568352/using-docker-compose-with-ci-how-to-deal-with-exit-codes-and-daemonized-linked
http://blog.ministryofprogramming.com/docker-compose-and-exit-codes/

This PR adds a `--forward-exitval <container>` flag that allows
`docker-compose up` to return the exit value of a specified container.
The container may optionally have a number specified (foo_2) otherwise
the first is defaulted to.

Signed-off-by: Nathan J. Mehl <n@climate.com>
2017-02-27 08:37:11 -08:00
Harald Albers 2943d2e61d Activate bash completion for Windows executable
Signed-off-by: Harald Albers <github@albersweb.de>
2017-02-23 14:41:08 +01:00
Harald Albers 39b2c6636e Fix treatment of global arguments in bash completion
Signed-off-by: Harald Albers <github@albersweb.de>
2017-02-21 17:54:20 +01:00
Peter Urda a67500ee57
Added `top` to `docker-compose` to display running processes.
This commit allows `docker-compose` to access `top` for containers
much like running `docker top` directly on a given container.

This commit includes:

* `docker-compose` CLI changes to expose `top`
* Completions for `bash` and `zsh`
* Required testing for the new `top` command

Signed-off-by: Peter Urda <peter.urda@gmail.com>
2017-02-01 15:42:30 -08:00
Allan de Queiroz f01ecda83c Fixing bash path problem, avoiding 'docker-compose-completion.sh: bash: bad interpreter: No such file or directory' error
Signed-off-by: Allan de Queiroz <allandequeiroz@gmail.com>
2017-01-04 11:45:44 +00:00
Bheesham Persaud b0b9a3703d Add fish completion to contrib.
Signed-off-by: Bheesham Persaud <me@bheesham.com>
2016-12-03 11:19:28 -05:00
Matt Bray a37d99f201 Zsh completion: change --file description text
Signed-off-by: Matt Bray <mattjbray@gmail.com>
2016-09-30 00:45:46 +01:00
Matthew Bray 90356b7040 Zsh completion: permit multiple --file arguments
Before this change:

```
$ docker-compose --file docker-compose.yml -<TAB>
 -- option --
--help                 -h  -- Get help
--host                 -H  -- Daemon socket to connect to
--project-name         -p  -- Specify an alternate project name (default: directory name)
--skip-hostname-check      -- Don't check the daemon's hostname against the name specified in the client certificate (for example if your docker host is an IP address)
--tls                      -- Use TLS; implied by --tlsverify
--tlscacert                -- Trust certs signed only by this CA
--tlscert                  -- Path to TLS certificate file
--tlskey                   -- Path to TLS key file
--tlsverify                -- Use TLS and verify the remote
--verbose                  -- Show more output
--version              -v  -- Print version and exit
```

(Note the `--file` argument is no longer available to complete.)

After this change:

```
docker-compose --file docker-compose.yml -<TAB>
 -- option --
--file                 -f  -- Specify an alternate docker-compose file (default: docker-compose.yml)
--help                 -h  -- Get help
--host                 -H  -- Daemon socket to connect to
--project-name         -p  -- Specify an alternate project name (default: directory name)
--skip-hostname-check      -- Don't check the daemon's hostname against the name specified in the client certificate (for example if your docker host is an IP address)
--tls                      -- Use TLS; implied by --tlsverify
--tlscacert                -- Trust certs signed only by this CA
--tlscert                  -- Path to TLS certificate file
--tlskey                   -- Path to TLS key file
--tlsverify                -- Use TLS and verify the remote
--verbose                  -- Show more output
--version              -v  -- Print version and exit
```

Signed-off-by: Matt Bray <mattjbray@gmail.com>
2016-09-28 12:04:13 +01:00
Aanand Prasad 6633f1962c Shell completion for --push-images
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-07-27 16:00:53 +01:00
Joffrey F 79ddf06267 Merge pull request #3662 from albers/completion-bundle--fetch-digests
bash completion for `docker-compose bundle --fetch-digests`
2016-07-07 10:39:18 -07:00
Aanand Prasad bc0939dcf0 Merge pull request #3645 from leonhartX/zsh-completion-bundle
add zsh completion support for bundle
2016-06-30 10:32:44 -07:00
Aanand Prasad c0237a487b Merge pull request #3221 from aeriksson/fix-zsh-autocomplete
Fix zsh autocomplete
2016-06-29 11:08:08 -07:00
Harald Albers 622de27c1e bash completion for `docker-compose bundle --fetch-digests`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-06-29 08:45:36 -07:00
Ke Xu edd28f09d1 change dsb to dab
Signed-off-by: Ke Xu <leonhartx.k@gmail.com>
2016-06-29 11:01:50 +09:00
Joffrey F 93cc2675c8 Merge pull request #3625 from albers/completion-bundle
bash completion for `docker-compose bundle`
2016-06-28 15:52:37 -07:00
Joffrey F 3649df83ab Merge pull request #3626 from albers/completion-push
bash completion for `docker-compose push`
2016-06-28 15:52:14 -07:00
Andre Eriksson c3247e7af8 zsh autocomplete: update misleading comment
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:07:59 -07:00
Andre Eriksson b3d4e9c9d7 zsh autocomplete: break out duplicated flag messages into variables
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson 0058b4ba0c zsh autocomplete: replace use of sed with cut
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson 612d263d74 zsh autocomplete: fix issue when filtering on already selected services
Previously, the filtering on already selected services would break when
one service was a substring of another.

This commit fixes that.

Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson 048408af48 zsh autocomplete: fix missing services issue for build/pull commands
Previously, the autocomplete for the build/pull commands would only add
services for which build/image were the _first_ keys, respectively, in
the docker-compose file.

This commit fixes this, so the appropriate services are listed
regardless of the order in which they appear

Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson d990f7899c zsh autocomplete: pass all relevant flags to docker-compose/docker
For autocomplete to work properly, we need to pass along some flags when
calling docker (--host, --tls, …) and docker-compose (--file, --tls, …).

Previously flags would only be passed to docker-compose, and the only
flags passed were --file and --project-name.

This commit makes sure that all relevant flags are passed to both
docker-compose and docker.

Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson 97ba14c82a zsh autocomplete: use two underscores for all function names
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson 1b5a94f4e4 zsh autocomplete: bring flag help texts up to date
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson 8d2fbe3a55 zsh autocomplete: add 'build' flag for 'create' and 'up'
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson eb10f41d13 zsh autocomplete: fix incorrect flag exclusions for 'create' and 'up'
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson 73a1b60ced zsh autocomplete: add missing 'remove-orphans' flag for 'up' and 'down'
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson b3d9652cc3 zsh autocomplete: add missing docker-compose base flags
Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Andre Eriksson cbb44b1a14 fix broken zsh autocomplete for version 2 docker-compose files
This has the added benefit of making autocompletion work when the
docker-compose config file is in a parent directory.

Signed-off-by: Andre Eriksson <aepubemail@gmail.com>
2016-06-27 11:00:17 -07:00
Ke Xu a0a90b2352 add zsh completion for push
Signed-off-by: Ke Xu <leonhartx.k@gmail.com>
2016-06-27 18:00:52 +09:00
Ke Xu aa7f522ab0 add zsh completion support for bundle
Signed-off-by: Ke Xu <leonhartx.k@gmail.com>
2016-06-27 17:48:14 +09:00
Harald Albers f49b624d95 bash completion for `docker-compose push`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-06-22 17:19:20 +02:00
Harald Albers e5c5dc09f8 bash completion for `docker-compose bundle`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-06-22 17:06:30 +02:00
Harald Albers c46737ed02 remove command completion for `docker-compose rm --a`
As `--all|-a` is deprecated, there's no use to suggest it any
more in command completion.

Signed-off-by: Harald Albers <github@albersweb.de>
2016-05-26 12:48:53 -07:00
Aanand Prasad 85e2fb63b3 Merge pull request #3218 from sdurrheimer/zsh-completion-run-workdir
Add zsh completion for 'docker-compose run -w --workdir'
2016-03-29 16:50:12 +01:00
Aanand Prasad 024a810617 Merge pull request #3217 from sdurrheimer/zsh-completion-up-build
Add zsh completion for 'docker-compose up --build'
2016-03-29 16:49:49 +01:00
Aanand Prasad 668d45c7cc Merge pull request #3216 from sdurrheimer/zsh-completion-logs
Add zsh completion for 'docker-compose logs -f --follow --tail -t --t…
2016-03-29 16:49:36 +01:00
Aanand Prasad 09ea74245d Merge pull request #3215 from sdurrheimer/zsh-completion-exec-command
Add zsh completion for 'docker-compose exec' command
2016-03-29 16:49:15 +01:00
Steve Durrheimer 8ae8f7ed4b Add zsh completion for 'docker-compose run -w --workdir'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-03-25 19:25:33 +01:00
Steve Durrheimer 9729c0d3c7 Add zsh completion for 'docker-compose up --build'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-03-25 19:15:34 +01:00
Steve Durrheimer 9d58b19ecc Add zsh completion for 'docker-compose logs -f --follow --tail -t --timestamps'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-03-25 19:09:53 +01:00
Steve Durrheimer 63b448120a Add zsh completion for 'docker-compose exec' command
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-03-25 19:03:36 +01:00
Steve Durrheimer 0f1fb42326 Add zsh completion for 'docker-compose rm -a --all'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-03-25 18:52:28 +01:00
Joffrey F d78b013bb0 Merge pull request #3204 from albers/completion-rm--all
bash completion for `docker-compose rm --all`
2016-03-24 10:44:36 -07:00
Joffrey F aabeb56527 Merge pull request #3206 from albers/completion-exec
bash completion for `docker-compose exec`
2016-03-24 10:44:19 -07:00
Harald Albers c9b02b7b34 bash completion for `docker-compose exec`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-03-24 18:02:12 +01:00
Joffrey F 87231a25be Merge pull request #3202 from albers/completion-logs
bash completion for new `docker logs` options
2016-03-24 09:56:12 -07:00
Harald Albers b030c3928a bash completion for `docker-compose rm --all`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-03-24 17:29:04 +01:00
Harald Albers 5416e4c99b bash completion for `docker-compose up --build`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-03-24 17:21:56 +01:00
Harald Albers d8fb9d8831 bash completion for new `docker logs` options
Signed-off-by: Harald Albers <github@albersweb.de>
2016-03-24 17:11:10 +01:00
Harald Albers 5b2c2e332f bash completion for TLS options
Signed-off-by: Harald Albers <github@albersweb.de>
2016-03-24 12:06:10 +01:00
Harald Albers 9094c4d97d prepare bash completion for new TLS options
Up to now there were two special top-level options that required special
treatment: --project-name and --file (and their short forms).
For 1.7.0, several TLS related options were added that have to be passed
to secondary docker-compose invocations as well.
This commit introduces a scalable treatment of those options.

Signed-off-by: Harald Albers <github@albersweb.de>
2016-03-24 12:05:59 +01:00
Harald Albers e3c1b5886a bash completion for `docker-compose run --workdir`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-03-18 10:47:17 +01:00
Joffrey F 20c29f7e47 Add flag to up/down to remove orphaned containers
Add --remove-orphans to CLI reference docs
Add --remove-orphans to bash completion file
Test orphan warning and remove_orphan option in up

Signed-off-by: Joffrey F <joffrey@docker.com>
2016-03-15 16:11:49 -07:00
Harald Albers 0049743615 add support for multiple compose files to bash completion
Since 1.6.0, Compose supports multiple compose files specified with `-f`.
These need to be passed to the docker invocations done by the
completion.

Signed-off-by: Harald Albers <github@albersweb.de>
2016-03-02 21:18:33 +01:00
Aanand Prasad 85ba08bb13 Merge pull request #2932 from AvdN/patch-1
reset colors after warning
2016-02-18 09:25:02 -08:00
Anthon van der Neut 1512793b30 for 1.6.0 the version value needs to be a string
After conversion a file would immediately not load in docker-compose 1.6.0 with the message:

  ERROR: Version in "./converted.yml" is invalid - it should be a string.

Signed-off-by: Anthon van der Neut anthon@mnt.org
Signed-off-by: Anthon van der Neut <a.van.der.neut@ruamel.eu>
2016-02-17 10:01:16 +01:00
Anthon van der Neut 69d0154718 reset colors after warning
If a warning is shown, and you happen to have no color setting in your (bash) prompt, the \033[37m setting, stays active. With the message hardly readable (light grey on my default light yellow background), that means the prompt is barely visible and you need to do `tput reset`.
Would probably be better if the background color was set as well in case you have dark on light theme by default in your terminal.

Signed-off-by: Anthon van der Neut <a.van.der.neut@ruamel.eu>
2016-02-16 15:42:43 +01:00
Aanand Prasad 1816147d57 Merge pull request #2740 from albers/completion-create
bash completion for `docker-compose create`
2016-02-01 15:44:07 +00:00
Aanand Prasad c1cb75cc4f Merge pull request #2741 from sdurrheimer/zsh-completion-create-command
Add zsh completion for 'docker-compose create'
2016-02-01 15:43:47 +00:00
Daniel Nephin 40d69675f3 Merge pull request #2745 from albers/completion-services
Fix computation of service lists in bash completion
2016-01-28 16:08:46 -05:00
Aanand Prasad 7d403d09cf Extract helper methods
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-26 16:08:34 +00:00
Aanand Prasad aa4d43af0b Create declarations for named volumes
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-26 16:07:26 +00:00
Aanand Prasad f86fe11825 Make sure version line is at the top of the file
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-26 15:54:18 +00:00
Aanand Prasad 47b22e90f9 Make warnings a bit more readable
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-26 15:53:25 +00:00
Aanand Prasad 4736b4409a Update for links, external_links, network_mode
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-26 15:53:02 +00:00
Harald Albers 73a0d83075 Fix computation of service list in bash completion
The previous approach assumed that the service list could be extracted
from a single file. It did not follow extends and overrides.

Signed-off-by: Harald Albers <github@albersweb.de>
2016-01-25 15:51:58 +01:00
Steve Durrheimer 381d58bc66 Add zsh completion for 'docker-compose create'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-01-25 10:27:21 +01:00
Harald Albers 7f3a319ecc bash completion for `docker-compose create`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-01-25 10:15:14 +01:00
Daniel Nephin 85619842be Add migration script.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-19 14:50:41 -05:00
Aanand Prasad 413cdbcb81 Merge pull request #2675 from sdurrheimer/zsh-completion-up-abort-on-container-exit
Add zsh completion for 'docker-compose up --abort-on-container-exit'
2016-01-19 10:41:08 +00:00
Aanand Prasad 683c8b0067 Merge pull request #2676 from sdurrheimer/zsh-completion-down-command
Add zsh completion for 'docker-compose down'
2016-01-19 10:40:29 +00:00
Steve Durrheimer d54190167a Fix zsh completion to ensure we have enough commands to store in the cache
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-01-16 13:53:16 +01:00
Steve Durrheimer f6561f1290 Add zsh completion for 'docker-compose down'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-01-16 13:47:48 +01:00
Steve Durrheimer e7180982aa Add zsh completion for 'docker-compose up --abort-on-container-exit'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-01-16 13:22:02 +01:00
Joffrey F 842dc14417 Merge pull request #2660 from albers/completion-down
bash completion for `docker-compose down`
2016-01-14 15:17:45 -08:00
Harald Albers fca3e47a75 bash completion for `docker-compose up --abort-on-container-exit`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-01-14 10:43:53 -08:00
Harald Albers a7be0afa5b bash completion for `docker-compose down`
Signed-off-by: Harald Albers <github@albersweb.de>
2016-01-14 10:32:06 -08:00
Aanand Prasad a08e02f3bd Merge pull request #2643 from sdurrheimer/zsh-completion-events
Add zsh completion for 'docker-compose events'
2016-01-13 21:10:36 +00:00
Aanand Prasad 9f34354c19 Merge pull request #2638 from albers/completion-events
Add bash completion for `docker-compose events`
2016-01-13 21:10:09 +00:00
Aanand Prasad a027a0079c Use networking for version 2 Compose files
- Remove --x-networking and --x-network-driver
- There's now no way to set a network driver - this will be added back
  with the 'networks' key

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-01-12 21:29:40 +00:00
Steve Durrheimer b59387401c Add zsh completion for 'docker-compose events'
Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
2016-01-12 22:04:05 +01:00