picocli

## Class CommandLine.UnmatchedArgumentException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - picocli.CommandLine.PicocliException
        - - picocli.CommandLine.ParameterException
          - - picocli.CommandLine.UnmatchedArgumentException

- All Implemented Interfaces:
    Serializable
  Enclosing class:
    CommandLine

      public static class CommandLine.UnmatchedArgumentException
      extends CommandLine.ParameterException

  Exception indicating that a command line argument could not be mapped to any of the fields annotated with `CommandLine.Option` or `CommandLine.Parameters`.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnmatchedArgumentException(CommandLine commandLine, List<String> args)`
    `UnmatchedArgumentException(CommandLine commandLine, Stack<String> args)`
    `UnmatchedArgumentException(CommandLine commandLine, String msg)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<String>` | `getSuggestions()` Returns suggested solutions if such solutions exist, otherwise returns an empty list.
    `List<String>` | `getUnmatched()` Returns the unmatched command line arguments.
    `boolean` | `isUnknownOption()` Returns `true` if the first unmatched command line arguments resembles an option, `false` otherwise.
    `static boolean` | `printSuggestions(CommandLine.ParameterException ex, PrintStream out)` Returns `true` and prints suggested solutions to the specified stream if such solutions exist, otherwise returns `false`.
    `boolean` | `printSuggestions(PrintStream out)` Returns `true` and prints suggested solutions to the specified stream if such solutions exist, otherwise returns `false`.

    - ### Methods inherited from class picocli.CommandLine.ParameterException

      `getArgSpec, getCommandLine, getValue`

    - ### 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 Detail

    - #### UnmatchedArgumentException

          public UnmatchedArgumentException(CommandLine commandLine,
                                            String msg)

    - #### UnmatchedArgumentException

          public UnmatchedArgumentException(CommandLine commandLine,
                                            Stack<String> args)

    - #### UnmatchedArgumentException

          public UnmatchedArgumentException(CommandLine commandLine,
                                            List<String> args)

  - ### Method Detail

    - #### printSuggestions

          public static boolean printSuggestions(CommandLine.ParameterException ex,
                                                 PrintStream out)

      Returns `true` and prints suggested solutions to the specified stream if such solutions exist, otherwise returns `false`.
      Since:
        3.3.0

    - #### getUnmatched

          public List<String> getUnmatched()

      Returns the unmatched command line arguments.
      Since:
        3.3.0

    - #### isUnknownOption

          public boolean isUnknownOption()

      Returns `true` if the first unmatched command line arguments resembles an option, `false` otherwise.
      Since:
        3.3.0

    - #### printSuggestions

          public boolean printSuggestions(PrintStream out)

      Returns `true` and prints suggested solutions to the specified stream if such solutions exist, otherwise returns `false`.
      Since:
        3.3.0

    - #### getSuggestions

          public List<String> getSuggestions()

      Returns suggested solutions if such solutions exist, otherwise returns an empty list.
      Since:
        3.3.0

Copyright © 2019. All rights reserved.