kellpossible / cargo-i18n

A Rust Cargo sub-command and libraries to extract and build localization resources to embed in your application/library
MIT License
125 stars 26 forks source link

Command line completions #72

Open kellpossible opened 3 years ago

kellpossible commented 3 years ago

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.

mrtryhard commented 2 months 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
alerque commented 1 month ago

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 commented 3 weeks ago

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

alerque commented 3 weeks ago

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?