Package org.apache.commons.cli

# Class UnrecognizedOptionException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.commons.cli.ParseException
org.apache.commons.cli.UnrecognizedOptionException

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `AmbiguousOptionException`

public class UnrecognizedOptionException extends ParseException
Thrown during parsing signaling an unrecognized option.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UnrecognizedOptionException(String message)`
  Constructs a new `UnrecognizedArgumentException` with the specified detail message.
  `UnrecognizedOptionException(String message, String option)`
  Constructs a new `UnrecognizedArgumentException` with the specified option and detail message.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getOption()`
  Gets the unrecognized option.

  ### Methods inherited from class org.apache.commons.cli.ParseException

  `wrap`

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### UnrecognizedOptionException

    public UnrecognizedOptionException(String message)
    Constructs a new `UnrecognizedArgumentException` with the specified detail message.
    Parameters:
      `message` - the detail message

  - ### UnrecognizedOptionException

    public UnrecognizedOptionException(String message, String option)
    Constructs a new `UnrecognizedArgumentException` with the specified option and detail message.
    Parameters:
      `message` - the detail message
      `option` - the unrecognized option
    Since:
      1.2

- ## Method Details

  - ### getOption

    public String getOption()
    Gets the unrecognized option.
    Returns:
      the related option
    Since:
      1.2