ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.53k stars 624 forks source link

completion/docker{,-compose}: Load completions from packages #527

Closed akinomyoga closed 4 months ago

akinomyoga commented 4 months ago

Fixes #517

@MonkeyKiKi @marco-gallegos I've updated the completion scripts. I haven't tested it. Could you test it?

First, it's better to load the completion script coming with Docker and Docker Compose themselves if they are found in the system. So the new version first searches the system for the completion files from the packages. Only when they are not found, the OMB completions source the versions bundled with OMB. I also updated the completions bundled with OMB.

MonkeyKiki commented 4 months ago

I don't know how to test a pull request. Please tell me how to and I will happily test it

akinomyoga commented 4 months ago

OK, then the easiest way is probably to clone the repository and temporarily set the OSH to that cloned directory.

  1. Clone the repository into the temporary directory omb-test
$ git clone https://github.com/akinomyoga/oh-my-bash.git omb-test -b update-docker-completion
  1. Change the value of OSH in your ~/.bashrc
# your bashrc

...

# export OSH=~/.oh-my-bash # please comment out the original path
export OSH=/path/to/omb-test # add this line for testing

...

Please replace /path/to/omb-test to the actual path to the omb-test directory created in step 1.

After finishing the test, you can simply revert the change to your ~/.bashrc and remove the directory omb-test.

MonkeyKiki commented 4 months ago

Hi @akinomyoga. Thanks for the tutorial. Your change works fine for me. Would you like me to do more tests ?

akinomyoga commented 4 months ago

@MonkeyKiki Thank you for testing! I think it's enough for now. If you notice an issue later, you can any time open a new issue. I'll later merge the PR.

akinomyoga commented 4 months ago

Thanks. I've merged it.