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

[feature] Shell completions #245

Closed
Freed-Wu opened this issue May 17, 2023 · 6 comments · Fixed by #258
Closed

[feature] Shell completions #245

Freed-Wu opened this issue May 17, 2023 · 6 comments · Fixed by #258

Comments

@Freed-Wu
Copy link

Can this program provides completions for common shells? I guess https://docs.rs/clap_complete/latest/clap_complete/ can be a helper. Same as https://github.com/dalance/svls

@DaveMcEwan
Copy link
Contributor

Both svlint and svls use clap in the same way to construct the command-line interface.
@Freed-Wu Can you provide some examples of what you'd like to see?

@Freed-Wu
Copy link
Author

Some examples: typst/typst#545 git-lfs/git-lfs#5104

@DaveMcEwan
Copy link
Contributor

Sounds like shell completions could be useful but I'm still not exactly sure what you're after. Perhaps you could open a pull request?

@Freed-Wu
Copy link
Author

I am not familiar with rust 😢 I just think shell completions is useful so I hope every program I like can support it.

@DaveMcEwan
Copy link
Contributor

@Freed-Wu I've added a command-line option --dump-completion to my branch. Would you like to check that you're happy with it?
To do that: Clone my repo, use rustup if you haven't already, checkout the api branch, then cargo run -- --dump-completion=bash > path/to/completionFile, and whatever you think is necessary to test the feature.

@Freed-Wu
Copy link
Author

Works for me!

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 a pull request may close this issue.

2 participants