Commons CLI
  1. Commons CLI
  2. CLI-132

MissingOptionException should contain a useful error message

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0, 1.1
    • Fix Version/s: 1.1
    • Component/s: CLI-1.x
    • Labels:
      None

      Description

      Most exception message contain a useful message string like "Missing argument for option:". The MissingOptionException contains only the missing options. Adding a message to the exception would make it easier to catch a ParseException and display the getMessage() string.

      1. bug132.patch
        2 kB
        Brian Egge

        Issue Links

          Activity

          Brian Egge created issue -
          Brian Egge made changes -
          Field Original Value New Value
          Link This issue is a clone of CLI-131 [ CLI-131 ]
          Brian Egge made changes -
          Description The help formatter auto usage returns the options in a somewhat random order. This is because the options are inserted in a HashMap, and then a copy of the collection is returned with the getOptions() method.

          The getOptions method should return the options in the order they were added, or in a sorted order.
          Most exception message contain a useful message string like "Missing argument for option:". The MissingOptionException contains only the missing options. Adding a message to the exception would make it easier to catch a ParseException and display the getMessage() string.
          Brian Egge made changes -
          Attachment bug132.patch [ 12358919 ]
          Henri Yandell made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Mark Thomas made changes -
          Workflow jira [ 12405513 ] Default workflow, editable Closed status [ 12601450 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Brian Egge
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development