Package io.github.qishr.cascara.common.util
Class UnmatchedArgumentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.qishr.cascara.common.util.CommandLine.PicocliException
io.github.qishr.cascara.common.util.CommandLine.ParameterException
io.github.qishr.cascara.common.util.CommandLine.UnmatchedArgumentException
Enclosing Class:
io.github.qishr.cascara.common.util.CommandLine
public static class UnmatchedArgumentException
extends ParameterException
Exception indicating that a command line argument could not be mapped to any of the fields annotated with Option or Parameters.
Constructor Summary
| Constructor | Description |
|---|---|
| UnmatchedArgumentException(CommandLine commandLine, String msg) | |
| UnmatchedArgumentException(CommandLine commandLine, Stack<String> args) | |
| UnmatchedArgumentException(CommandLine commandLine, List<String> args) | |
| UnmatchedArgumentException(CommandLine commandLine, List<String> args, String extraMsg) |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public static boolean | printSuggestions(ParameterException ex, PrintStream out) | Returns true and prints suggested solutions to the specified stream if such solutions exist, otherwise returns false. |
| public static boolean | printSuggestions(ParameterException ex, PrintWriter writer) | Returns true and prints suggested solutions to the specified writer if such solutions exist, otherwise returns false. |
| public List<String> | getUnmatched() | Returns the unmatched command line arguments. |
| public boolean | isUnknownOption() | Returns true if the first unmatched command line arguments resembles an option, false otherwise. |
| public boolean | printSuggestions(PrintStream out) | Returns true and prints suggested solutions to the specified stream if such solutions exist, otherwise returns false. |
| public boolean | printSuggestions(PrintWriter writer) | Returns true and prints suggested solutions to the specified stream if such solutions exist, otherwise returns false. |
| public List<String> | getSuggestions() | Returns suggested solutions if such solutions exist, otherwise returns an empty list. |
Methods inherited from ParameterException
getArgSpec, getValue, getCommandLine
Method Details
printSuggestions
public static boolean printSuggestions(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(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
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
getSuggestions
public List<String> getSuggestions()
Returns suggested solutions if such solutions exist, otherwise returns an empty list.
Since:
3.3.0