commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Keyes <>
Subject Re: [CLI] Problems with Java-like properties
Date Mon, 10 Feb 2003 15:29:22 GMT

I am currently doing some work on a redesign of CLI.  The support for
Java properties will be built into the parser so you could retrieve
them like:

  Properties props = parseResult.getProperties();

So using your example there would be two entries in the Properties

This will allow people to handle the properties in whatever manner
they wish e.g. add them to an application context, set them as 
system properties, etc.

-John K

On Mon, 2003-02-10 at 13:12, Edwards, Peter wrote:
> When I use "-Da=1 -Db=2" the method getOptionValues returns an array of [a,
> 1, b, 2]. Obviously I need to then treat them as pairs. But what if the
> command line was used to flag that an option exists but has no value. Then
> "-Da -Db=2" returns [a, b, 2] I can no longer treat them as pairs. The user
> can solve this by entering "-Da= -Db=2" which returns [a, ,b, 2] but I
> wondered if it would be better to return a hashmap of names with a list of
> values for that name. There would no longer be any ambiguity for the
> developer.
> Pete Edwards
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
John Keyes <>

View raw message