Package picocli

Class CommandLine.UnmatchedArgumentException

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getSuggestions()
      Returns suggested solutions if such solutions exist, otherwise returns an empty list.
      java.util.List<java.lang.String> getUnmatched()
      Returns the unmatched command line arguments.
      boolean isUnknownOption()
      Returns true if the first unmatched command line arguments resembles an option, false otherwise.
      boolean printSuggestions​(java.io.PrintStream out)
      Returns true and prints suggested solutions to the specified stream if such solutions exist, otherwise returns false.
      boolean printSuggestions​(java.io.PrintWriter writer)
      Returns true and prints suggested solutions to the specified stream if such solutions exist, otherwise returns false.
      static boolean printSuggestions​(CommandLine.ParameterException ex, java.io.PrintStream out)
      Returns true and prints suggested solutions to the specified stream if such solutions exist, otherwise returns false.
      static boolean printSuggestions​(CommandLine.ParameterException ex, java.io.PrintWriter writer)
      Returns true and prints suggested solutions to the specified writer if such solutions exist, otherwise returns false.
      • 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,
                                          java.lang.String msg)
      • UnmatchedArgumentException

        public UnmatchedArgumentException​(CommandLine commandLine,
                                          java.util.Stack<java.lang.String> args)
      • UnmatchedArgumentException

        public UnmatchedArgumentException​(CommandLine commandLine,
                                          java.util.List<java.lang.String> args)
      • UnmatchedArgumentException

        public UnmatchedArgumentException​(CommandLine commandLine,
                                          java.util.List<java.lang.String> args,
                                          java.lang.String extraMsg)
    • Method Detail

      • printSuggestions

        public static boolean printSuggestions​(CommandLine.ParameterException ex,
                                               java.io.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,
                                               java.io.PrintWriter writer)
        Returns true and prints suggested solutions to the specified writer if such solutions exist, otherwise returns false.
        Since:
        4.0
      • getUnmatched

        public java.util.List<java.lang.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​(java.io.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​(java.io.PrintWriter writer)
        Returns true and prints suggested solutions to the specified stream if such solutions exist, otherwise returns false.
        Since:
        4.0
      • getSuggestions

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