picocli

## Class CommandLine.RunAll

- java.lang.Object
- - picocli.CommandLine.RunAll

All Implemented Interfaces:
  CommandLine.IParseResultHandler

Enclosing class:
  CommandLine

    public static class CommandLine.RunAll
    extends java.lang.Object
    implements CommandLine.IParseResultHandler

Command line parse result handler that prints help if requested, and otherwise executes the top-level command and all subcommands as `Runnable` or `Callable`. For use in the `parseWithHandler` methods.

Since:
  2.0

### Constructor Summary

Constructors
Constructor and Description
`CommandLine.RunAll()`

### Method Summary

Methods
`java.util.List<java.lang.Object>` `handleParseResult(java.util.List<CommandLine> parsedCommands, java.io.PrintStream out, CommandLine.Help.Ansi ansi)` Prints help if requested, and otherwise executes the top-level command and all subcommands as `Runnable` or `Callable`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CommandLine.RunAll

    public CommandLine.RunAll()

### Method Detail

#### handleParseResult

    public java.util.List<java.lang.Object> handleParseResult(java.util.List<CommandLine> parsedCommands,
                                                     java.io.PrintStream out,
                                                     CommandLine.Help.Ansi ansi)

Prints help if requested, and otherwise executes the top-level command and all subcommands as `Runnable` or `Callable`. If any of the `CommandLine` commands does not implement either `Runnable` or `Callable`, a `ExecutionException` is thrown detailing the problem and capturing the offending `CommandLine` object.

Specified by:
  `handleParseResult` in interface `CommandLine.IParseResultHandler`
Parameters:
  `parsedCommands` - the `CommandLine` objects that resulted from successfully parsing the command line arguments
  `out` - the `PrintStream` to print help to if requested
  `ansi` - for printing help messages using ANSI styles and colors
Returns:
  an empty list if help was requested, or a list containing the result of executing all commands: the return values from calling the `Callable` commands, `null` elements for commands that implement `Runnable`
Throws:
  `CommandLine.ExecutionException` - if a problem occurred while processing the parse results; use `CommandLine.ExecutionException.getCommandLine()` to get the command or subcommand where processing failed