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

Autocomplete generation #52

Closed
Slakah opened this issue Jan 21, 2019 · 3 comments
Closed

Autocomplete generation #52

Slakah opened this issue Jan 21, 2019 · 3 comments

Comments

@Slakah
Copy link

Slakah commented Jan 21, 2019

I've never really looked into it in earnest, but it feels like it could be cool to generate a bash autocomplete file from a supplied com.monovore.decline.Command. This functionality feels like it would be a separate module though.

@bkirwi
Copy link
Owner

bkirwi commented Jan 25, 2019

Indeed! I think this would be a pretty natural fit.

I imagine this could mostly be done in a seperate module, like you suggest, just by inspecting the command. The one thing that might be tricky is allowing tab-completion for values... given a Opts.option[Path](...) it really feels like you should be able to tab-complete files, but we don't hang on to enough information to thread that through to a bash autocomplete file. One path might be to: figure out a small ADT to represent completions, add a field to the Opts types that have arguments, and add another method to Argument to set a default value.

I'm unlikely to implement this myself anytime soon, but I'd be happy to review contributions of this shape if you / someone else is interested!

@kubukoz
Copy link
Contributor

kubukoz commented Oct 21, 2021

Rel: #250 (tbh I'd suggest merging the two)

@bkirwi
Copy link
Owner

bkirwi commented Oct 23, 2021

Sure - let's close this one since it's had less discussion.

@bkirwi bkirwi closed this as completed Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants