Package nz.org.riskscape.picocli
Interface CommandLine.IExceptionHandler
- All Known Implementing Classes:
CommandLine.DefaultExceptionHandler
- Enclosing class:
- CommandLine
Deprecated.
Represents a function that can handle a ParameterException
that occurred while
parsing the command line arguments. This is a
functional interface
whose functional method is handleException(CommandLine.ParameterException, PrintStream, CommandLine.Help.Ansi, String...)
.
Implementations of this function can be passed to the CommandLine::parseWithHandlers
methods to handle situations when the command line could not be parsed.
-
Method Summary
Modifier and TypeMethodDescriptionhandleException
(CommandLine.ParameterException ex, PrintStream out, CommandLine.Help.Ansi ansi, String... args) Deprecated.Handles aParameterException
that occurred while parsing the command line arguments and optionally returns a list of results.
-
Method Details
-
handleException
List<Object> handleException(CommandLine.ParameterException ex, PrintStream out, CommandLine.Help.Ansi ansi, String... args) Deprecated.Handles aParameterException
that occurred while parsing the command line arguments and optionally returns a list of results.- 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 invalidout
- thePrintStream
to print help to if requestedansi
- for printing help messages using ANSI styles and colorsargs
- the command line arguments that could not be parsed- Returns:
- a list of results, or an empty list if there are no results
-
CommandLine.execute(String...)
,CommandLine.IParameterExceptionHandler
andCommandLine.IExecutionExceptionHandler