-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make shell completion DRYer and less hacky #1498
Comments
Wow! That's fantastic. I'm happy to see completion growing in weight (I didn't dare to ask about such features before). Another difficult to implement feature that this proposal solves (taken from the releasenotes):
|
Nice thinking! $ docker-compose services --with-option="build"
$ docker-compose services --with-running-container How about using a $ docker-compose services --filter option=build
$ docker-compose services --filter status=running (Going off-topic alert); |
+1 to provide a |
+1 for the |
|
With the addition of multiple compose files (#2051), and the recently introduced search of compose.yml in parent directories, this feature is gaining weight. I think it would also be useful if Compose could output the "effective configuration", i.e. the actual result of combining the yaml files. Maven got the notion of an "effective POM" that is the result of an internal bas POM and the user provided pom.xml. |
I think so too. The proposal for that is #1953 |
I would be interested in working on this. Is there still interest in having this implemented? |
Yes, that is still relevant. You're welcome! Bash completion needs to enumerate services with several states (paused, stopped, running). It currently does so by getting the list of containers and then inspecting each one, collecting matching service names: There's also code that enumerates services defined by a It would be really nice to get native support by docker-compose for both use cases. |
Thanks to @albers and @sdurrheimer, we now have both bash and zsh completion, which is fantastic. However, they (understandably) both do a lot of hacky stuff to read the YAML file without actually parsing YAML properly, and they both implement this separately.
We could potentially add some commands/flags to Compose that would give them the information they need in a simple shell-parseable format. Going off a quick scan of the bash script, it looks like it'd be useful to be able to list:
extends
to get the correct configuration, which I doubt would be any fun at all to implement in shell scriptPerhaps a
docker-compose services
command:The text was updated successfully, but these errors were encountered: