You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by sagun shakya <Sa...@Sun.COM> on 2009/03/26 02:38:51 UTC
why is my withArgName argument being overwritten
Hi,
I have an Option created as:
Option fooOption = OptionBuilder.withDescription("add foo")
.withLongOpt("add_foo")
.hasArgs(2)
.withArgName("foo")
.withArgName("bar")
.create("baz");
When I call |*printUsage <http://commons.apache.org/cli/api-1.0/org/apache/commons/cli/HelpFormatter.html#printUsage%28java.io.PrintWriter,%20int,%20java.lang.String,%20org.apache.commons.cli.Options%29
>*(PrintWriter <http://java.sun.com/j2se/1.3/docs/api/java/io/PrintWriter.html
> pw,
int width,
String <http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html
> app,
Options <http://commons.apache.org/cli/api-1.0/org/apache/commons/cli/Options.html
> options)|
by passing in fooOption. The usage for the cli only outputs
usage: mytestCli [-baz <bar>]
How do I get to print both "foo" and "bar"
TIA,
Re: why is my withArgName argument being overwritten
Posted by Jörg Schaible <jo...@gmx.de>.
sagun shakya wrote at Donnerstag, 26. März 2009 02:38:
> Hi,
>
> I have an Option created as:
> Option fooOption = OptionBuilder.withDescription("add foo")
> .withLongOpt("add_foo")
> .hasArgs(2)
> .withArgName("foo")
> .withArgName("bar")
> .create("baz");
Because the OptionBuilder builds always only one option at a time.
http://commons.apache.org/cli/usage.html
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org