Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic, on-demand autocomplete #816

Closed
Xion opened this issue Jan 14, 2017 · 1 comment
Closed

Dynamic, on-demand autocomplete #816

Xion opened this issue Jan 14, 2017 · 1 comment

Comments

@Xion
Copy link

Xion commented Jan 14, 2017

In Python, there is a package called argcomplete which provides very flexible autocompletion for apps that use the standard argparse module. What it allows is to implement a custom completion provider: essentially a piece of your own code that's executed when the the binary is invoked in a Special Way (tm) by the shell-specific completion script.

For an example, see here. The code is preparing completions dynamically from the filesystem, or even from a remote API (if certain flag isn't passed (flags are partially parsed at this point)).

Having something like this in clap would be very nice. I know this is a potentially complex subsystem so it'd be unreasonable to expect it implemented anytime, but I wanted to at least put this feature on the radar.

@kbknapp
Copy link
Member

kbknapp commented Jan 14, 2017

Thanks for taking the time to suggest this! It's been mentioned before in #568 but hasn't been implemented yet. There's still some design details that need to be figured out, but it's something I do want to add. I'm going to close this issue but copy your comments over to 568.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants