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

Auto-generate shell completions with clap_complete #273

Closed
wants to merge 2 commits into from
Closed

Auto-generate shell completions with clap_complete #273

wants to merge 2 commits into from

Conversation

cyqsimon
Copy link
Contributor

Having the completion scripts auto-generated by clap_complete makes far more sense than manually maintaining the completion scripts IMO.

@cyqsimon
Copy link
Contributor Author

I think CI needs fixing

@dbrgn
Copy link
Collaborator

dbrgn commented May 28, 2022

This issue was tracked in #220 and a resolution attempt was started in #256. However, we noticed that the generated completions do not support dynamically generated values (i.e. completing the TLDR pages that are installed on the system). I haven't yet checked your proposal, does it solve these issues?

@niklasmohrin
Copy link
Collaborator

Thank you for contributing! This topic has come up before, see #220. Back then we found that it isn't possible to have completion for the page names, but only the flags. We feel like this is a pretty big cost and moved forward with our hand crafted completion files. if this still isn't possible, I would stick to our decision from then. :/

@cyqsimon
Copy link
Contributor Author

Sorry I haven't considered this feature. I'll investigate if it's possible to integrate this feature with clap_complete.

@cyqsimon cyqsimon marked this pull request as draft May 29, 2022 01:06
@cyqsimon
Copy link
Contributor Author

After some digging around, I do concur with your conclusions in #256.

Although it's certainly possible (and quite easy TBH) to have clap_complete generate scripts, then modify them with a patch script, it's another piece of puzzle that requires maintenance and frankly very hacky. It's probably not worth going down that rabbit hole either.

Therefore I do agree that manually maintaining the completion scripts are the best solution for now. Closing PR.

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

Successfully merging this pull request may close these issues.

3 participants