Open davidism opened 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.
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:
shell_complete
method that provides completions at that level and can be overridden. Parameters additionally accept ashell_complete
function in__init__
to override or extend the type's completion.However, Click doesn't provide these features:
install
command. This is probably out of scope for Click.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
ininstall_requires
, then have the next version specifyclick>=8
and continue to support the parts that Click doesn't provide.