I suspect the problem is that you're using -D parameters (which are used to
set java runtime environment variables) rather than your own options. Also,
I'm not aware of CLI supporting multiple option values in the same option.
It would be better to simply add multiple options for the various parameters
you are trying to capture.
If you must put all of those parameter name/value pairs into a single
option, it might be better to do it like this:
-P value=key,nextvalue=newkey,hello=world
You can then split them using the "," delimiter, and split them again using
the "=" delimiter to get the name/value pairs that you want.
Hope this helps,
Mark
On 9/1/07, Bodo Tasche <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> At the moment I am trying add commons-cli 1.1 to a small application,
> but I have a small problem with it.
>
> I used the code shown on the example page:
>
> Option property = OptionBuilder.withArgName( "property=value" )
> .hasArg()
> .withValueSeparator()
> .withDescription( "use value for given
> property" )
> .create( "D" );
>
>
> But when I give the program the following arguments:
>
> java -jar test.jar -Dvalue=key -Dnextvalue=newkey -Dhello=world
>
> I only geht the first value=key pair. Even when using
> getOptionValues("D") .
>
> Any suggestions?
>
> Thanks,
> Bodo
> --
> http://www.tvbrowser.org
> http://www.wannawork.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>