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

boolean option in documentation is woorking oposite way documented

    Details

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

      Description

      In documentation it says as follows:

      CommandLine parse(Options options,
      String[] arguments,
      boolean stopAtNonOption)
      throws ParseException

      stopAtNonOption - specifies whether to continue parsing the arguments if a non option is encountered.

      The parser stops an throws Exception if "stopAtNonOption" is set to false (when I guess it should be other way round), if I set boolean "true", the parser ignores unknown arguments and continues without throwing Exception.

        Activity

        Hide
        ebourg Emmanuel Bourg added a comment -

        This isn't an error in the documentation but it might be more explicit: if stopAtNonOption is true an unrecognized token stops the parsing and the remaining tokens are added as extra arguments. If stopAtNonOption is false the parsing breaks with an exception.

        "Stop" doesn't refer to the action of throwing an exception, it refers to the change of the parser behavior.

        Show
        ebourg Emmanuel Bourg added a comment - This isn't an error in the documentation but it might be more explicit: if stopAtNonOption is true an unrecognized token stops the parsing and the remaining tokens are added as extra arguments. If stopAtNonOption is false the parsing breaks with an exception. "Stop" doesn't refer to the action of throwing an exception, it refers to the change of the parser behavior.
        Hide
        ebourg Emmanuel Bourg added a comment -

        I updated the javadoc to better explain the stopAtNonOption parameter. I hope this will clear the confusion.

        Show
        ebourg Emmanuel Bourg added a comment - I updated the javadoc to better explain the stopAtNonOption parameter. I hope this will clear the confusion.

          People

          • Assignee:
            Unassigned
            Reporter:
            anla2973 Anders Larsson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 10m
              10m
              Remaining:
              Remaining Estimate - 10m
              10m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development