Details
Description
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( "] " );
=============> changed
}
// else ignore
}