-
Notifications
You must be signed in to change notification settings - Fork 64
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
Improved CLI argument handling using picocli
#1534
Conversation
…mporary class CliBaseNew.java to support the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great! Thanks for taking care of this refactoring. I left a few minor comments directly on the code.
Just resolved conflicts to trigger a CI run. Please check if I did it correctly :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, @patilatharva! I understood that you had started working on unit tests. Is that coming along or do you need help with those?
There are some strange test failures that are popping up, so this definitely needs some more work. You can ignore the build failure in Maven for now. Either I'll push a fix for that or we punt on it and wait until the Maven build support gets removed from this repository (we only need it to build Epoch, which will soon be hosted in its own repo). |
Thanks, looks good to me!
Definitely, looking into it now. |
…to picocli Merged javadoc fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
picocli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great improvement. I added a couple of comments, mostly small things. I hope we can resolve them quickly and merge this soon!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating review status to "request changes".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your quick fixes! This is ready to be merged as far as I am concerned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the version TODO
and once fixed we can merge this. Thanks, @patilatharva!
Objective
Use Picocli instead of Apache Commons CLI to parse command line options and parameters in Lfc.java, Lff.java and CliBase.java.
Reason
Migrating from Commons CLI to picocli
Tasks:
CliBase.java
to implement theRunnable
interface, to support Picocli.runMain
inCliBase.java
because Picocli handles simple validation and--help
/--version
options.CLIOption
enum (Lfc.java
/Lff.java
).run()
method as an entry point to post-argument parsing execution, in accordance with theRunnable
interface (Lfc.java
/Lff.java
).filterProps
into a new functionfilterPassOnProps
to create code gen properties from Picocli options (CliBase.java
).runTool
intorunTool
+invokeGenerator
inLfc.java
, andrunTool
intorunTool
+formatAllFiles
inLff.java
.