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

Message for an illegal character in an option should contain more information

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • CLI-1.x
    • None

    Description

      Currently the code in org.apache.commons.cli.OptionValidator generates an IllegalArgumentException which contains the message:-

      "illegal option value '" + ch + "'"

      This is generated in two places, one for single character options and one for multi character options.

      However this does not tell the caller which option it is contains this
      character, which makes debugging the error without the source (i.e most users) extremely difficult.

      Would it not be possible to change the message to:-

      "illegal option '" + opt + "' value '" + ch + "'"

      which would then at least identify the offending option.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dfg David Goodenough
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: