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

[cli] Passing properties in Parser does not work for options with a single argument

    Details

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

      Operating System: other
      Platform: Other

    • Bugzilla Id:
      31148

      Description

      processProperties(Properties properties) in Parser.java calls opt.hasArgs().
      The hasArgs() function in Option.java returns true if the option has multiple
      values (this.numberOfArgs > 1). So for options with a single argument this
      returns false.
      A simple fix is to change the opt.hasArgs() call to opt.hasArg() in Parser.java.

        Activity

        Hide
        roxspring Rob Oxspring added a comment -

        Added test to BugsTest and fixed in CVS

        Thanks,

        Rob

        Show
        roxspring Rob Oxspring added a comment - Added test to BugsTest and fixed in CVS Thanks, Rob

          People

          • Assignee:
            Unassigned
            Reporter:
            gawor@mcs.anl.gov Jarek Gawor
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development