commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerry Pulley <>
Subject commons-cli HelpFormatter
Date Fri, 02 Sep 2005 07:37:39 GMT
Regarding CLI,

"Well done" to all contributors, and thanks for CLI.  Over the years I'd 
developed my own, uh, "technique" for doing command line options, and I 
always dreaded it.  No more pain.

I've corrected a couple of minor flaws in HelpFormatter, and made two 
minor changes with regard to auto option formatting.  I've sent along 
the modified files, feel free to use them or not as you see fit. You can 
find all my changes with a grep "jp:".  Here's a summary of changes with 
(approximate) line numbers.

A) HelpFormatter was printing the 2nd and later members of option groups 
both in the group and as standalone options.  (HelpFormatter #248 in the 
modified file.)

B) HelpFormatter was not printing a space after an option group. 
(HelpFormatter #278 in the modified file.)

X) To give predictable order of option printing, I changed a few 
HashMaps to LinkedHashMap at Options #91-100 and OptionGroup #76.  That 
introduces a JVM version dependency, so you might not want to keep it.  
I don't know if it's worth doing the work in a 1.2-compatible way.  For 
heaven's sake, though, please don't introduce a dependency on that 
horrible commons collections stuff.

Y) I added printing of argument names to the options in groups in 
HelpFormatter.  The HelpFormatter change is at #268 in the modified 
version.  I added an option-by-short-name accessor to OptionGroup at #97 
to support that.


View raw message