Aloso / to-html

Utilities for making the colo documentation
MIT License
75 stars 10 forks source link

Provide shell completions #21

Closed CosmicHorrorDev closed 1 year ago

CosmicHorrorDev commented 1 year ago

I'm planning on adding support for generating shell completions (through clap_complete). There are a few different ways that it can be handled, so it figured it would be good to open an issue to discuss things first. The three ways I know of are

  1. Generate completions at runtime using something like a --gen-completion {SHELL} flag
  2. Generate completions at build time using a build.rs
  3. Generate completions ahead of time using a cargo-xtask task that is run manually before a release

There is no clear winner unfortunately:

Any thoughts?

Aloso commented 1 year ago

I don't have a strong opinion on this. I'd just generate the completions at build time and publish them in the next GitHub release. I'd also add them to the AUR package so they're installed automatically.

Generating them at runtime is a "nice to have", but not necessary; users can download and install the completions with curl.

CosmicHorrorDev commented 1 year ago

Sounds like a build script is the winner then! I'll work on opening a PR for that tomorrow

I'd also add them to the AUR package so they're installed automatically.

Will do :)