Hi Russel,
Thank you for testing CLI 1.2, your feedback is much welcome.
One important difference of CLI 1.1 is that options are only
instantiated once. With your example, the two -J options are
materialized by a single Option with 4 values, but since you specified
hasArgs(2), the Option actually holds 2 values (source, 1.5).
So the solution to "fix" your example with CLI 1.1 is to change
hasArgs(2) into hasArgs(), and then get the list of values for the -J
option with cmdline.getOptionValues('J'). This will return an array with
[source, 1.5, target, 1.5].
I don't think this is the right behavior, the number of arguments should
be per occurrence of the option, and we should add a property telling if
the option is repeatable.
Emmanuel Bourg
Russel Winder a écrit :
in 1.0 using:
options.addOption(
OptionBuilder.withArgName( "property=value" )
.withValueSeparator()
.hasArgs(2)
.withDescription("")
.create( "J" ));
allowed options of the form: -Jsource=1.5 -Jtarget=1.5
compiling this with 1.2-SNAPSHOT leads to lots of messages:
error: file not found: target=1.5
indicating the difference in semantics between 1.0 and 1.1 and later.
Is there anywhere a 1.0 -> 1.1 upgrade manual explaining the semnatic
differences and what to do about them?
Thanks.
Yes I have started looking at upgrading Gant and Groovy from 1.0 to
1.2-SNAPSHOT :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]