commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sagun shakya <Sagun.Sha...@Sun.COM>
Subject why is my withArgName argument being overwritten
Date Thu, 26 Mar 2009 01:38:51 GMT
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,

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message