commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Keyes <>
Subject [CLI] Version 2.0 - API
Date Tue, 04 Mar 2003 00:06:19 GMT
Hi guys,

I've put some work into implementing the second version of CLI.  There 
some work to do to help ease the pain of people migrating from version 
So if people have been using version 1, please please please go look at 
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 
-Dproperty=value).  Also, the fact that there were three different 
implementations served to confuse the use of CLI.  So, I have 
it so there is only one implementation.  This will make the use case 
simpler.  There was also very little differentiation between boolean 
options and
options that had values.  So I have introduced the Argument type for 
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 
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 
I will be adding the PatternOptionBuilder and I will introduce the 
builder (Nick Chalkos submission) also.  There will also be an XSLT 
that will transform an XML representation of an options definition into 
class that constructs the Options.  The reflection builder and this 
should buffer users from any further API change on the definition side, 
the API changes again in future releases.  I would hope that it doesn't 
after this, it has dragged on too long already....

Some other points of note are, support for child options, support for 
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.

-John K


- - - - - - - - - - - - - - - - - - - - - - -

Jakarta Commons CLI

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message