Open kellpossible opened 3 years ago
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
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).
@alerque Either would be fine I think! Personally I use the runtime generated completions for most of the tools these days.
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?
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.