bartib icon indicating copy to clipboard operation
bartib copied to clipboard

`generate`/`gen`/`completions` command: Generate shell completions

Open simonsan opened this issue 1 year ago • 1 comments

I see that you are using clap for the CLI, there is https://crates.io/crates/clap_complete to automatically generate shell completions. It would be nice, to be able to generate completions for different shells by just calling bartib completions >> {my_shell_profile}. Here is a possible implementation: https://github.com/rustic-rs/rustic/blob/main/src/commands/completions.rs

Depending on if you want to further generate other files (e.g a bartib.toml for configuration of e.g. style of reports, default timezones etc.) it would be useful to have that under bartib gen completions (in the future maybe there could be a bartib gen configor just the top-level bartib completions.

simonsan avatar Jan 23 '24 06:01 simonsan

Thank you for bringing this crate to my attention. I didn't know it existed. This looks like something bartib should definitely have.

nikolassv avatar Jan 23 '24 09:01 nikolassv