Package picocli

Class 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:
  • Field Details

  • Constructor Details

    • UnmatchedArgumentException

      public UnmatchedArgumentException(CommandLine commandLine, String msg)
    • UnmatchedArgumentException

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

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

      public UnmatchedArgumentException(CommandLine commandLine, List<String> args, String extraMsg)
  • Method Details

    • 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
    • printSuggestions

      public static boolean printSuggestions(CommandLine.ParameterException ex, PrintWriter writer)
      Returns true and prints suggested solutions to the specified writer if such solutions exist, otherwise returns false.
      Since:
      4.0
    • getUnmatched

      public List<String> getUnmatched()
      Returns the unmatched command line arguments.
      Since:
      3.3.0
    • stripErrorMessage

      static List<String> stripErrorMessage(List<String> unmatched)
    • 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
    • printSuggestions

      public boolean printSuggestions(PrintWriter writer)
      Returns true and prints suggested solutions to the specified stream if such solutions exist, otherwise returns false.
      Since:
      4.0
    • str

      private static String str(List<String> list)
    • prefixCommandName

      private List<String> prefixCommandName(List<String> suggestions)
    • getSuggestions

      public List<String> getSuggestions()
      Returns suggested solutions if such solutions exist, otherwise returns an empty list.
      Since:
      3.3.0
    • isUnknownOption

      private static boolean isUnknownOption(List<String> unmatch, CommandLine cmd)
    • describe

      private static String describe(List<String> unmatch, CommandLine cmd)
    • quoteElements

      static String quoteElements(List<String> list)