-
Notifications
You must be signed in to change notification settings - Fork 418
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
GenerateCompletion cannot be used if the parent has an usageHelp Option with scope = INHERIT #1673
Comments
(Note: it must be the same for HelpCommand or others default commands you provide) |
@aheritier Thank you for raising this. I can take a look at doing a similar solution as what I did for #1319. That said, you mention this:
This sounds strange. I don't understand why I believe Quarkus command mode ensures that picocli has a |
Hi @remkop For the |
@aheritier I would guess Quarkus first since it would be a problem with the dependency injection. |
@remkop thanks for the pointer, I opened quarkusio/quarkus#25475 with a reproducer to track this quarkus side. |
@aheritier and @PierreBtz I see that the Quarkus people helped resolve the issue with injection into the About the original problem: Hope this is useful for others. |
Hi @remkop Awesome. Effectively it is exactly what I was looking for. In parallel we were also able to implement an IVersionProvider You rock. Thanks a lot |
Context
We have CLI (quarkus based but not relevant here) with multiple sub-commands.
We want to provide the classical
-h/--help
options in all commands but not-v/--version
(For the version we are using a dedicated command which is allowing us to@Inject
some components which is not possible with aversionProvider
).Thus we want to use an help Option inherited by all sub-commands instead of using
mixinStandardHelpOptions
with a Command and scopeINHERIT
)It gives such kind of code:
Problem
It doesn't work because
-h
is considered as duplicated between the command we write and the one in GenerateCompletion.It is similar to #1319 AFAWCS
Workaround
For now, the workaround it to declare the help option with scope = INHERIT in all our subcommands and to declare it with no inheritance in the TopLevel command.
Is there a better solution from your POV @remkop ?
The text was updated successfully, but these errors were encountered: