Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: CLI-1.x
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

    • Bugzilla Id:
      37838

      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( " | " ); }

      }
      buff.append( "] " );
      =============> changed
      }
      // else ignore
      }

        Activity

        Hide
        mvdb@apache.org Martin van den Bemt added a comment -

        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.

        Show
        mvdb@apache.org Martin van den Bemt added a comment - 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.

          People

          • Assignee:
            Unassigned
            Reporter:
            gepas@sinonet.de L.Gao
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development