You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/07/04 23:36:23 UTC

DO NOT REPLY [Bug 21349] New: - HelpFormatter is only able to print last option that has a longOpt and no shortOpt.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21349>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21349

HelpFormatter is only able to print last option that has a longOpt and no shortOpt.

           Summary: HelpFormatter is only able to print last option that has
                    a longOpt and no shortOpt.
           Product: Commons
           Version: 1.0 Beta 2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: jsd@oncable.dk


When having more that one option that only has a longOpt and no shortOpt, only
the last option of these will be printed by the HelpFormatter.

in Options.java this should fix the problem:

212c212,214
<         return new ArrayList( shortOpts.values() );
---
>         Set tmpSet = new HashSet(longOpts.values());
>         tmpSet.addAll(shortOpts.values());
>         return new ArrayList( tmpSet );

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org