Package picocli

Class CommandLine.DefaultExceptionHandler<R>

    • Constructor Detail

      • DefaultExceptionHandler

        public DefaultExceptionHandler()
        Deprecated.
    • Method Detail

      • handleException

        public java.util.List<java.lang.Object> handleException​(CommandLine.ParameterException ex,
                                                                java.io.PrintStream out,
                                                                CommandLine.Help.Ansi ansi,
                                                                java.lang.String... args)
        Deprecated.
        Description copied from interface: CommandLine.IExceptionHandler
        Handles a ParameterException that occurred while parsing the command line arguments and optionally returns a list of results.
        Specified by:
        handleException in interface CommandLine.IExceptionHandler
        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 invalid
        out - the PrintStream to print help to if requested
        ansi - for printing help messages using ANSI styles and colors
        args - the command line arguments that could not be parsed
        Returns:
        a list of results, or an empty list if there are no results
      • handleParseException

        public R handleParseException​(CommandLine.ParameterException ex,
                                      java.lang.String[] args)
        Deprecated.
        Prints the message of the specified exception, followed by the usage message for the command or subcommand whose input was invalid, to the stream returned by CommandLine.AbstractHandler.err().
        Specified by:
        handleParseException in interface CommandLine.IExceptionHandler2<R>
        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 invalid
        args - the command line arguments that could not be parsed
        Returns:
        the empty list
        Since:
        3.0