-
Notifications
You must be signed in to change notification settings - Fork 420
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
Annotation way to represent subcommands #152
Comments
What I did for Picocli Spring boot starter was to keep |
I'm thinking to address this by adding a Defining a subcommand hierarchy would look like this:
By calling
Subcommands referenced in a Custom type converters registered on an To parse the command line, use the
Thoughts? |
proposed subcommand attribute, to take array of classes is too good. Not sure why |
I hope that "too good" means you like it. :-)
The problem is that the domain object has no reference to the subcommands. |
Truly it is good, as I was thinking just opposite.. i.e. let
|
Ok, glad you like it. To be honest, I would not know how to implement this the other way around (subcommands knowing about their parent) because it requires the parent to dynamically discover all classes annotated with The above ( |
What you proposed can also help in a case, where same sub-command say
|
Yes, that was another consideration. |
I have not tried, but the solution is here, specially classindex https://stackoverflow.com/questions/259140/scanning-java-annotations-at-runtime |
It would be easy to make commands represented as subcommands through annotation rather than api way
Currently one needs to use addSubcommand api.
The text was updated successfully, but these errors were encountered: