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

Automatic shell completion generation using xtask. #1080

Merged
merged 2 commits into from
Mar 9, 2023

Conversation

ThomasFrans
Copy link
Contributor

This adds the option to automatically generate shell completion scripts for a variety of shells (currently bash, zsh, fish, elvish and powershell) using cargo xtask generate-shell-completion. It uses the crate clap_complete to automatically create these completions based on the clap::Command struct. It could be handy for package maintainers to add these scripts to their package.

Add automatic generation of shell completion scripts for various shells
(the ones supported by `clap_complete`). The scripts can be generated
using the `generate-shell-completion` xtask, which outputs the shell
script to stdout.
General improvements to both the shell completion generation as well as
the xtask package itself. Update the README to match the new additions.
@ThomasFrans
Copy link
Contributor Author

Quickly remade this PR as I based it on the work I did for the man page generation since this also required the xtasks. I don't know Git well enough to know what demons merging that previous one would have unleashed, so I quickly redid it based on the main branch which now has the xtask stuff included.

@hrkfdn hrkfdn merged commit e8adff4 into hrkfdn:main Mar 9, 2023
@hrkfdn
Copy link
Owner

hrkfdn commented Mar 9, 2023

Merged, thanks!

@ThomasFrans ThomasFrans deleted the feature-shell-completion-generation branch March 9, 2023 20:10
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.

None yet

2 participants