Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clap-completions] impl Generator for dyn Generator #5502

Open
2 tasks done
lolbinarycat opened this issue May 23, 2024 · 2 comments
Open
2 tasks done

[clap-completions] impl Generator for dyn Generator #5502

lolbinarycat opened this issue May 23, 2024 · 2 comments
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations

Comments

@lolbinarycat
Copy link

Please complete the following tasks

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.

@lolbinarycat lolbinarycat added the C-enhancement Category: Raise on the bar on expectations label May 23, 2024
@epage epage added the A-completion Area: completion generator label May 23, 2024
@epage
Copy link
Member

epage commented Jun 6, 2024

Could you provide a more concrete example of what you are trying to accomplish?

@lolbinarycat
Copy link
Author

having an array of generators, including those provided by other crates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion Area: completion generator C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

No branches or pull requests

2 participants