[clap-completions] impl Generator for dyn Generator
lolbinarycat opened this issue · comments
Please complete the following tasks
- I have searched the discussions
- I have searched the open and rejected issues
Clap Version
4.5.4
Describe your use case
being able to easily decide which shell to generate completions for at runtime without limiting yourself to only implementations of Generator found in clap-complete.
Describe the solution you'd like
add two new blanket implementations of Generator, one for &dyn Generator
and one for Box<dyn Generator>
.
Alternatives, if applicable
clap_complete::Shell
: can't represent generators defined outside of clap-complete.
Additional Context
Generator is already object-safe, so this should be an easy change.
Could you provide a more concrete example of what you are trying to accomplish?
having an array of generators, including those provided by other crates.