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

Command line completions #72

Open
kellpossible opened this issue Sep 12, 2021 · 4 comments
Open

Command line completions #72

kellpossible opened this issue Sep 12, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kellpossible
Copy link
Owner

Use https://docs.rs/clap_generate/3.0.0-beta.4/clap_generate/ to allow command line completion scripts to be generated for people who may want them.

@kellpossible kellpossible added enhancement New feature or request good first issue Good for newcomers labels Sep 12, 2021
@mrtryhard
Copy link
Contributor

Do you want them generated at compile-time in a specific output directory or do you want them output with a command i.e.

$ cli --completions bash
# bash script is output

@alerque
Copy link

alerque commented Oct 21, 2024

Compile time makes packaging (especially for cross-compiled builds) much easier.

That being said upstream Clap is aggressively moving away from allowing compile time completion generation. I'm hoping they don't completely eliminate the possibility but to date that's the direction they're headed (on the grounds that it makes easier for people who do ad-hoc cargo install to keep their shell completions matching the version they have installed by making them put the runtime generation command in their shell RC files).

@kellpossible
Copy link
Owner Author

@alerque Either would be fine I think! Personally I use the runtime generated completions for most of the tools these days.

@alerque
Copy link

alerque commented Oct 29, 2024

Personally I use the runtime generated completions for most of the tools these days.

Do you install "most of the tools" from your distro package manager or do you side-load them yourself with cargo install or other similar userspace tooling?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants