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

Add shell completion #325

Merged
merged 6 commits into from
Apr 15, 2024
Merged

Add shell completion #325

merged 6 commits into from
Apr 15, 2024

Conversation

tonglil
Copy link
Contributor

@tonglil tonglil commented Mar 30, 2024

Summary

Closes #324.

This is my first time writing Rust, please let me know if you have a preference for something else.
Followed the example here: https://github.com/clap-rs/clap/blob/master/clap_complete/examples/completion-derive.rs

I was hoping to also disable completion of the short version of each flag, prevent completion of flags until at least one hyphen was typed, and provide custom completion suggestions, but I don't think clap_complete supports those features yet.

Preflight checklist

  • Code formatted rustfmt ($ cargo fmt)
  • Code linter check with clippy ($ cargo clippy)
  • Relevant tests added
  • Any new documentation added

@tonglil tonglil marked this pull request as ready for review March 30, 2024 04:37
src/main.rs Show resolved Hide resolved
tonglil and others added 2 commits March 31, 2024 11:43
Co-authored-by: Mike Engel <mike@mike-engel.com>
@tonglil tonglil requested a review from mike-engel April 1, 2024 19:05
@mike-engel mike-engel merged commit e726e68 into mike-engel:main Apr 15, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

Shell completion
2 participants