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>
- 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>