Package nz.org.riskscape.picocli
Interface CommandLine.IParameterExceptionHandler
- Enclosing class:
- CommandLine
public static interface CommandLine.IParameterExceptionHandler
Classes implementing this interface know how to handle
ParameterExceptions
(usually from invalid user input).
Implementation Requirements:
Implementors that need to print messages to the console should use the output and error PrintWriters, and the color scheme from the CommandLine object obtained from the exception.
Implementation Note:
See CommandLine.getParameterExceptionHandler()
for a description of the default handler.
API Note:
This interface supersedes CommandLine.IExceptionHandler2
.
- Since:
- 4.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionint
handleParseException
(CommandLine.ParameterException ex, String[] args) Handles aParameterException
that occurred while parsing the command line arguments and returns an exit code suitable for returning fromCommandLine.execute(String...)
.
-
Method Details
-
handleParseException
Handles aParameterException
that occurred while parsing the command line arguments and returns an exit code suitable for returning fromCommandLine.execute(String...)
.- Parameters:
ex
- the ParameterException describing the problem that occurred while parsing the command line arguments, and the CommandLine representing the command or subcommand whose input was invalidargs
- the command line arguments that could not be parsed- Returns:
- an exit code
- Throws:
Exception
-