click-contrib / click-completion

Add or enhance bash, fish, zsh and powershell completion in Click
MIT License
288 stars 32 forks source link

Click's completion system has been rewritten #37

Open davidism opened 3 years ago

davidism commented 3 years ago

See pallets/click#1484 and pallets/click#1622. The documentation can be found here for now: https://click.palletsprojects.com/en/8.0.x/shell-completion/. In the new system:

However, Click doesn't provide these features:

Due to all these changes, the click-completion won't work with the next release of Click. We've talked about merging this project into Click before, but I think we pretty much have what we want in core at this point. One option is to make a release that specifies click<8 in install_requires, then have the next version specify click>=8 and continue to support the parts that Click doesn't provide.

ssbarnea commented 3 years ago

I am bit disappointed that click refuses to provide a full end-to-end solution for enabling completion on shell tools.

I would really wish someone finds a way to auto-install these extensions when the the tool runs first time, or at least to prompt user to do that. Also installation should be done in a way that degrades gracefully, for example if user removes the tool, we do not want to see an error next time he logs in.

If anyone has an example that makes the installation much easier for the users, so tool authors do not need to write extensive documentation for each shell, it would really be useful. Personally I am interested to cover only bash and zsh for start.