commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33635] New: - Wrong OptionCount at options with aliases
Date Fri, 18 Feb 2005 15:53:56 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33635>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33635

           Summary: Wrong OptionCount at options with aliases
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: klaus.kopruch@materna.de


If you define

    final Option help = obuilder
                    .withShortName("h")
                    .withShortName("help")
                    .withShortName("?")
                    .withDescription("print usage")
                    .create();
    obuilder.reset();                    

and call

    CommandLine line;
    line = processCommandLine(new String[] {"-hy"});
    assertEquals(new String[] {"-h"}, line);

then assertEquals(...); 

  public static void assertContentsEqual(final Collection expected, final
Collection found) {
    assertTrue(expected.containsAll(found));
    assertTrue(found.containsAll(expected));
    assertEquals(expected.size(), found.size());
  }

fails at the last line. If you do the same with

    final Option help = obuilder
                    .withShortName("h")
                    .withDescription("print usage")
                    .create();
    obuilder.reset();                    

then the test is green. If you retest with

    final Option help = obuilder
                    .withShortName("h")
                    .withShortName("help")
                    .withDescription("print usage")
                    .create();
    obuilder.reset();                    

the test again fails.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
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