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

Negative arguments should take the priority over numerical options

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None

      Description

      A negative argument can be mistaken for an option, for example with the options '1' and 'N' both having an argument, the following command line:

      -N -123

      will be interpreted as the option N with no argument, and the option 1 with 23 as argument. But the right interpretation is N=-123. The token -123 has been processed as a potential option first before being considered as the argument of the previous option.

      This is consistent with JOpt Simple.

        Activity

        Hide
        ebourg Emmanuel Bourg added a comment -

        Fixed by the default parser.

        Show
        ebourg Emmanuel Bourg added a comment - Fixed by the default parser.

          People

          • Assignee:
            ebourg Emmanuel Bourg
            Reporter:
            ebourg Emmanuel Bourg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development