Hi,

Err, there is a bug in commons-cli, the OptionBuilder implicitely initializes
argNames with null, so the first option created, if it takes arguments, will have
them with no names, hence not listed by the HelpFormatter.


The "patch" follows (if at all needed ;-):

diff -c -r1.15 OptionBuilder.java
*** cli/src/java/org/apache/commons/cli/OptionBuilder.java 9 Dec 2002 23:47:24 -0000 1.15
--- cli/src/java/org/apache/commons/cli/OptionBuilder.java 7 Sep 2003 22:21:15 -0000
***************
*** 79,85 ****
private static String description;


      /** argument name */
!     private static String argName;

      /** is required? */
      private static boolean required;
--- 79,85 ----
      private static String description;

      /** argument name */
!     private static String argName = "arg";

      /** is required? */
      private static boolean required;

Great stuff, BTW. Being able to write a complete CLI parser in 10 lines, plus the free help print, gotta love that.

Cheers,

Matthieu


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to