Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Implement the script base class org.codehaus.groovy.cli.JCommanderScript so that scripts can have purely declarative (annotation defined) processing of command line options.
Script base classes now support the wrapping of script bodies with arbitrary code (GROOVY-6585). That allows cool features like this. For many purposes the base script does not need to be in Groovy itself since there are Grapes. But this one does because if specify the base script class at the command line with the --basescript option (GROOVY-6615) then it must be something already on the CLASSPATH.
The bad news is that Apache CLI is still in the dark ages and does not have an annotation scheme yet. Groovy may eventually do something about that (GROOVY-6090), but that isn't happening right now. The good news is that Groovy does have JCommander by virtue of including TestNG. Therefore the solution is to put this class in the groovy-testng subproject for those who want it. Those who don't can safely ignore its existence.