Package 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:
java.io.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 withCommandLine.Option
orCommandLine.Parameters
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private java.util.List<java.lang.String>
unmatched
-
Constructor Summary
Constructors Constructor Description UnmatchedArgumentException(CommandLine commandLine, java.lang.String msg)
UnmatchedArgumentException(CommandLine commandLine, java.util.List<java.lang.String> args)
UnmatchedArgumentException(CommandLine commandLine, java.util.List<java.lang.String> args, java.lang.String extraMsg)
UnmatchedArgumentException(CommandLine commandLine, java.util.Stack<java.lang.String> args)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
describe(java.util.List<java.lang.String> unmatch, CommandLine cmd)
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()
Returnstrue
if the first unmatched command line arguments resembles an option,false
otherwise.private static boolean
isUnknownOption(java.util.List<java.lang.String> unmatch, CommandLine cmd)
boolean
printSuggestions(java.io.PrintStream out)
Returnstrue
and prints suggested solutions to the specified stream if such solutions exist, otherwise returnsfalse
.boolean
printSuggestions(java.io.PrintWriter writer)
Returnstrue
and prints suggested solutions to the specified stream if such solutions exist, otherwise returnsfalse
.static boolean
printSuggestions(CommandLine.ParameterException ex, java.io.PrintStream out)
Returnstrue
and prints suggested solutions to the specified stream if such solutions exist, otherwise returnsfalse
.static boolean
printSuggestions(CommandLine.ParameterException ex, java.io.PrintWriter writer)
Returnstrue
and prints suggested solutions to the specified writer if such solutions exist, otherwise returnsfalse
.(package private) static java.lang.String
quoteElements(java.util.List<java.lang.String> list)
private static java.lang.String
str(java.util.List<java.lang.String> list)
(package private) static java.util.List<java.lang.String>
stripErrorMessage(java.util.List<java.lang.String> unmatched)
-
Methods inherited from class picocli.CommandLine.ParameterException
getArgSpec, getCommandLine, getValue
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
unmatched
private java.util.List<java.lang.String> unmatched
-
-
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)
Returnstrue
and prints suggested solutions to the specified stream if such solutions exist, otherwise returnsfalse
.- Since:
- 3.3.0
-
printSuggestions
public static boolean printSuggestions(CommandLine.ParameterException ex, java.io.PrintWriter writer)
Returnstrue
and prints suggested solutions to the specified writer if such solutions exist, otherwise returnsfalse
.- Since:
- 4.0
-
getUnmatched
public java.util.List<java.lang.String> getUnmatched()
Returns the unmatched command line arguments.- Since:
- 3.3.0
-
stripErrorMessage
static java.util.List<java.lang.String> stripErrorMessage(java.util.List<java.lang.String> unmatched)
-
isUnknownOption
public boolean isUnknownOption()
Returnstrue
if the first unmatched command line arguments resembles an option,false
otherwise.- Since:
- 3.3.0
-
printSuggestions
public boolean printSuggestions(java.io.PrintStream out)
Returnstrue
and prints suggested solutions to the specified stream if such solutions exist, otherwise returnsfalse
.- Since:
- 3.3.0
-
printSuggestions
public boolean printSuggestions(java.io.PrintWriter writer)
Returnstrue
and prints suggested solutions to the specified stream if such solutions exist, otherwise returnsfalse
.- Since:
- 4.0
-
str
private static java.lang.String str(java.util.List<java.lang.String> list)
-
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
-
isUnknownOption
private static boolean isUnknownOption(java.util.List<java.lang.String> unmatch, CommandLine cmd)
-
describe
private static java.lang.String describe(java.util.List<java.lang.String> unmatch, CommandLine cmd)
-
quoteElements
static java.lang.String quoteElements(java.util.List<java.lang.String> list)
-
-