You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Papendieck, Thomas" <Th...@opitz-consulting.com> on 2011/08/01 10:06:46 UTC

AW: [cli] help should display "--long-option=VALUE"

Hello Emmanuel,

thank you for your reply!

But I see download links for 1.2 only. 
How do I get binary distribution of 1.3?

bye
Thomas

________________________________________
Von: Emmanuel Bourg [ebourg@apache.org]
Gesendet: Sonntag, 31. Juli 2011 23:03
Bis: Commons Users List
Cc: Papendieck, Thomas
Betreff: Re: [cli] help should display "--long-option=VALUE"

Hi Thomas,

In your example the value separator should not be specified, it's usage
is not the one you expect.

To change the character displayed between the option name and the value
you have to call HelpFormatter.setLongOptSeparator('='), this method is
new in CLI 1.3.

Emmanuel Bourg



Le 04/07/2011 12:43, Papendieck, Thomas a écrit :
> Dear members,
>
> I want my application displaying following help on command line:
> --long-option=VALUE
>
> Having read instructions on http://commons.apache.org/cli/usage.html I wrote following code for common-cli-1.2:
> options.addOption(
>         OptionBuilder.withLongOpt("long-option")
>           .withValueSeparator('=')
>           .hasArg()
>           .withArgName("VALUE")
>           .create());
>
> But the result is:
> --long-option<VALUE>
>
> How do I force common-cli to output --long-option=VALUE instead of --long-option<VALUE>?
>
> BTW: parsing the command line argument "--long-option=VALUE" works great.
>
> Is using cli-2 still the only chance as I found in this list posted by David<ac...@yahoo.es>  on  Mon, 24 Apr 2006 09:01:35 GMT?
>
> bye
> Thomas
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org