public static class CommandLine.DefaultExceptionHandler extends Object implements CommandLine.IExceptionHandler
PrintStream
, followed by the
usage message for the command or subcommand whose input was invalid.
Implementation roughly looks like this:
System.err.println(paramException.getMessage()); paramException.getCommandLine().usage(System.err);
Constructor and Description |
---|
DefaultExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
List<Object> |
handleException(CommandLine.ParameterException ex,
PrintStream out,
CommandLine.Help.Ansi ansi,
String... args)
Handles a
ParameterException that occurred while parsing the command
line arguments and optionally returns a list of results. |
public DefaultExceptionHandler()
public List<Object> handleException(CommandLine.ParameterException ex, PrintStream out, CommandLine.Help.Ansi ansi, String... args)
CommandLine.IExceptionHandler
ParameterException
that occurred while parsing the command
line arguments and optionally returns a list of results.handleException
in interface CommandLine.IExceptionHandler
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
- the PrintStream
to print help to if requestedansi
- for printing help messages using ANSI styles and colorsargs
- the command line arguments that could not be parsedCopyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.