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

Non-existing option is not reported as a failure when it follows an option that accepts multiple values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2
    • None
    • CLI-1.x
    • None
    • Java 7
      Linux/Windows

    Description

      If I define the following options:

              Option dest = OptionBuilder
                      .withArgName("-d")
                      .withDescription("Destination")
                      .hasArg()
                      .create("-d");
              dest.setRequired(true);
              Option filenames = OptionBuilder
                      .withArgName("-f")
                      .withDescription("Filenames; comma separated")
                      .hasArgs()
                      .withValueSeparator(',')
                      .create("-f");
      

      when I parse the following arguments

      -d c:\development\test -f abc.txt -qa hello
      

      rather than getting a ParseException, the code thinks abc.txt, -qa, hello are the values for the -f option.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Ivanovich Ivan C
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: