commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (CLI-15) [cli] HelpFormatter does not handle groups properly
Date Mon, 10 Jul 2006 06:28:31 GMT
     [ http://issues.apache.org/jira/browse/CLI-15?page=all ]
     
Henri Yandell reopened CLI-15:
------------------------------


Looks like there was a comment post-resolving, so re-opening.

> [cli] HelpFormatter does not handle groups properly
> ---------------------------------------------------
>
>          Key: CLI-15
>          URL: http://issues.apache.org/jira/browse/CLI-15
>      Project: Commons CLI
>         Type: Bug

>     Versions: 1.0
>  Environment: Operating System: All
> Platform: All
>     Reporter: Etienne Pelletier
>      Fix For: 2.0
>  Attachments: HelpFormatter.java, Option.java
>
> The HelpFormatter repeats Options that have previously been printed with the group.
> The problem is in the else block where options not belonging to a group are
> printed.  The code gets executed if it does not belong to a group -OR- if the
> group has already been printed.
>    if( group != null && !list.contains(group)) {
> // this gets executed when a new group is found
> ...
> } else {
>   // this gets executed if the group is OR ISN'T null, and if group is in list.  
>  ....
> }
> The else statement on line 267 should be as follows:
> } else if (group == null) {
> // This will make sure that options that have not been printed as part of a group
> // will not get printed again.
> ...
> }
> I believe this change fixes the problem.
> Also, the append on line 264 should add an extra space after the ] to make sure
> that there will be a space between the ] and the next option.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


Mime
View raw message