Issue Details (XML | Word | Printable)

Key: CLI-2
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: L.Gao
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons CLI

[cli] Wrong usage summary

Created: 08/Dec/05 09:27 PM   Updated: 15/Mar/07 04:49 PM
Return to search
Component/s: CLI-1.x
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified

Environment:
Operating System: other
Platform: Other

Bugzilla Id: 37838


 Description  « Hide
The options of a OptionGroup appears twice in the usage summary as shown by the
following example([-c]):

usage: [-quiet] [-debug] [-ax | -c][-c] -version [-verbose]
[-projecthelp] [-help]
-ax ax or c
-c ax or c

Also a space is missing after the OptionGroup.

I have corrected this error by modifying the file HelpFormatter.java, line up
247. I include the modified codes for reference:

if( group != null /&& !list.contains(group)/ ) {
=============> changed
if (!list.contains(group)) {
=============> added
// add the group to the processed list
list.add( group );

// get the names of the options from the OptionGroup
Collection names = group.getNames();

buff.append( "[" );

// for each option in the OptionGroup
for( Iterator iter = names.iterator(); iter.hasNext(); ) {
buff.append( iter.next() );
if( iter.hasNext() ) { buff.append( " | " ); }
}
buff.append( "] " );
=============> changed
}
// else ignore
}



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin van den Bemt added a comment - 11/Feb/06 07:00 AM
This is sort of already in svn (don't know if that was based on your report
though) . At least your if and the write of [ and ] has been moved to another
method.

Henri Yandell made changes - 16/May/06 10:03 AM
Field Original Value New Value
issue.field.bugzillaimportkey 37838 12342781
Henri Yandell made changes - 16/May/06 11:12 AM
Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
Component/s CLI [ 12311104 ]
Affects Version/s 1.0 Final [ 12311651 ]
Key COM-2629 CLI-2
Project Commons [ 12310458 ] Commons CLI [ 12310463 ]
Henri Yandell made changes - 16/May/06 12:06 PM
Affects Version/s 1.0 Final [ 12311698 ]
Repository Revision Date User Message
ASF #417079 Sun Jun 25 20:49:09 UTC 2006 bayard Moved the CLI2 converters to the top of the CLI-1 branch - probably dead code in the long term as the plan is to have a CLI-1 compliant facade onto CLI-2.
Files Changed
ADD /jakarta/commons/proper/cli/branches/cli-1.0.x/CLI2ConverterTest.java (from /jakarta/commons/proper/cli/branches/cli-1.0.x/src/test/org/apache/commons/cli/CLI2ConverterTest.java)
ADD /jakarta/commons/proper/cli/branches/cli-1.0.x/CLI2Converter.java (from /jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/CLI2Converter.java)
DEL /jakarta/commons/proper/cli/branches/cli-1.0.x/src/test/org/apache/commons/cli/CLI2ConverterTest.java
DEL /jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/CLI2Converter.java

Henri Yandell made changes - 10/Jul/06 01:25 PM
Fix Version/s 1.1 [ 12311979 ]
Bugzilla Id 37838
Henri Yandell made changes - 15/Mar/07 04:36 PM
Component/s CLI-1.x [ 12311672 ]
Henri Yandell made changes - 15/Mar/07 04:49 PM
Status Resolved [ 5 ] Closed [ 6 ]