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

[cli] A single char argument equals to an option makes parser to fail.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Operating System: Windows XP
      Platform: PC

    • 32936

    Description

      I've the following code:

      options.addOption(OptionBuilder.withLongOpt("label").hasArg().create("l"));
      options.addOption(OptionBuilder.withLongOpt("property-descriptor").hasArgs
      ().create("p"));
      ...

      if the args param of the parser is

      args[0] = "--label";
      args[1] = "p";
      args[ ] = ...

      ParseException is thrown with the following message: "no argument for:l".
      If I change args[1] using any character not used as short option's form the
      programs work. Any chars used as short option's form makes the parser to fail.

      Attachments

        Activity

          People

            Unassigned Unassigned
            claudio.rosati@acsys.it Claudio Rosati
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: