Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-325

When properties are retrieve for an Option that has both multiple arguments and a value separator only the first is retrieved.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0
    • Parser
    • None

    Description

      When the following is executed it fails on the check for 2 values.

       
      final Option option = Option.builder("x")

      .hasArgs()

      .valueSeparator()

      .desc("Multiple arg option with value separator.")

      .build();

      String[] args = {"-x", "A=a", "B=b"{color:#000000}};

      CommandLine
      cmdLine = DefaultParser.builder().build().parse(new Options().addOption(option), args);

      Properties props = cmdLine.getOptionProperties(option);

      assertEquals(2, props.size());

      assertEquals( "a", props.get("A"));

      assertEquals( "b", props.get("B"));

      Attachments

        Issue Links

          Activity

            People

              claude Claude Warren
              claude Claude Warren
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: