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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Nightly Builds
    • 1.1
    • CLI-1.x
    • None
    • Operating System: other
      Platform: Other

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: