You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Jerry Pulley <jp...@nycap.rr.com> on 2005/09/03 18:15:41 UTC
[cli] HelpFormatter
(Reposting with [cli] in subject line)
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.
Yrs,
Jerry
Re: [cli] HelpFormatter
Posted by John Keyes <jo...@gmail.com>.
Hi Jerry,
Thanks for this contribution. Can you create an issue in Bugzilla for this,
and attach your patch file. We have not decided whether to keep supporting
the original CLI package at this time. If you look in the source repository
you will notice an org.apache.commons.cli2 package, this is the latest code
base. By having this recorded in Bugzilla, at least we know it won't be
forgotten about.
Thanks,
-John K
On 9/3/05, Jerry Pulley <jp...@nycap.rr.com> wrote:
>
> (Reposting with [cli] in subject line)
>
> 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.
>
> Yrs,
> Jerry
>