- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
It's a flag passed to docker build that removes the intermediate
containers left behind on fail builds.
Signed-off-by: Adrian Budau <budau.adi@gmail.com>
Also adds a fix for an error message on some completions when no
compose file is present:
docker-compose build awk: cannot open docker-compose.yml (No such file or directory)
Signed-off-by: Harald Albers <github@albersweb.de>
In most of this file and in Dockers's bash completion the sort order of
options is to sort alphabetically by long option name.
The short options are put right behind their long couterpart.
This commit improves consistency.
Signed-off-by: Harald Albers <github@albersweb.de>
Wrong placement of `compopt -o` introduces an unexpected behavior that did
not matter as long as --help was the only option (you would probably not
continue to type after --help): completion of options would not automatically
append a whitespace character as expected.
For the outstanding addition of the --timeout option, which has an
argument, this would mean that the user would have to type an extra
whitespace after completion of --timeout before the argument could be
added.
Signed-off-by: Harald Albers <github@albersweb.de>