-
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
If a @Command
-annotated method is in a class extending a @Command
-annotated superclass, things break (another subcommand named [method] already exists for command [command]
)
#619
Comments
Oops, app screwed up and deleted my description. I've added an example now. |
If anyone else needs to find a way around this, I figured something out. I moved the annotation from Edit: it does mean Edit 2: or maybe it's called a nested class? I just said inner because it's inside the other, but I think it's actually called a nested class? |
Thank you reporting this! This is a bug: while walking the class hierarchy, picocli should get attributes from the superclass, including I will have a fix for this soon. |
…ommand caused `InitializationException`
I pushed a fix to the |
…ommand caused `InitializationException`
Fixed in the master branch as well as the |
Picocli 3.9.4 with a fix for this issue has been released. Enjoy! |
Example:
SuperClass.java
SubClass.java
Main.java
The error
It works if I remove the
@Command
annotation fromSuperClass
, or it works if I turnmethod()
into a class and add it toSubClass
'ssubcommands
, but not withSuperClass
being a@Command
andmethod()
being a method.The text was updated successfully, but these errors were encountered: