Hi guys,

I've put some work into implementing the second version of CLI. There is
some work to do to help ease the pain of people migrating from version 1.
So if people have been using version 1, please please please go look at the
Javadoc and let me know if you see problems.


There were a few reasons why I undertook the task of reimplementing the
API. One of the reasons was to build in support for Java properties (i.e.
-Dproperty=value). Also, the fact that there were three different parser
implementations served to confuse the use of CLI. So, I have reimplemented
it so there is only one implementation. This will make the use case much
simpler. There was also very little differentiation between boolean options and
options that had values. So I have introduced the Argument type for options
that have values, boolean options are represented by the Option type.


In version 1, when building the an Option there were two ways to do it,
via a builder or via helper methods on the Options instance. I have removed
the helper methods and now it means the only way to create instances is
via the Builders.


There are currently only two builders, OptionBuilder and ArgumentBuilder.
I will be adding the PatternOptionBuilder and I will introduce the reflection
builder (Nick Chalkos submission) also. There will also be an XSLT stylesheet
that will transform an XML representation of an options definition into a
class that constructs the Options. The reflection builder and this stylesheet
should buffer users from any further API change on the definition side, if
the API changes again in future releases. I would hope that it doesn't change
after this, it has dragged on too long already....


Some other points of note are, support for child options, support for anonymous
options e.g. in ant [target1 [target2 ...]], in maven [goal1 [goal2 ...]].


I think thats everything, so have a read of the Javadoc and send in your comments.
When we have had this discussion I will send a mail to commons-user to see if
there are any other comments that could be useful.


Cheers,
-John K

[1] http://www.integralsource.com/cli/2.0alpha1/

- - - - - - - - - - - - - - - - - - - - - - -
http://www.integralsource.com/weblog

Jakarta Commons CLI
http://jakarta.apache.org/commons/cli


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to