brgmnn / fish-docker-compose

Fish shell completions for docker-compose
MIT License
74 stars 10 forks source link

Consider using docker-compose introspection #14

Closed Fuco1 closed 6 years ago

Fuco1 commented 6 years ago

Describe the problem

They way the parsing for services/version is done currently seems a bit problematic. Docker compose has built-in introspection via docker-compose config [--services] so you can use the output of that to get the version or list of services.

This should also make it possible to get it to work with multiple docker compose files (via -f flag) as the output of that command is the "merged" list.

My fish-fu is quite weak but if you have some questions on docker I'm happy to answer those.

brgmnn commented 6 years ago

This is a great idea, thanks for bringing it to my attention. I'll have a look at it.

Fuco1 commented 6 years ago

I've found a little bit more complete project and created a PR with this very feature, it wasn't as time consuming as I thought: https://github.com/fisherman/docker-completion/pull/5

The cool thing there is that the whole thing is generated automatically from the output of docker --help or docker-compose --help so updating is quite trivial (just re-run the generator script).

Feel free to have a look or take the code :)