-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
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:
- Each shell can provide completion is a completely different way if needed.
- It's possible to register support for other shells.
- Every core object (command, group, chained group, argument, option, type) provides a
shell_completemethod that provides completions at that level and can be overridden. Parameters additionally accept ashell_completefunction in__init__to override or extend the type's completion. - Values for choice, file, path, and directories are completed. Path support is handled by the shell rather than emulated in Click.
- Arbitrary metadata can be attached to completions, which shell support could use however it likes in the completion script.
However, Click doesn't provide these features:
- Built-in PowerShell support. This could be added to Click, but my preference right now is for an extension to provide other shell support.
- An
installcommand. This is probably out of scope for Click. - Shell detection. This is out of scope for Click since it relies on an external dependency. I didn't consider implementing it because the method for loading the completion differs between shells anyway, so it's not any extra work to add the shell to the instruction.
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.
n1ngussbarnea
Metadata
Metadata
Assignees
Labels
No labels