Class CommandLine.RunAll
- java.lang.Object
-
- org.apache.logging.log4j.core.tools.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 asRunnableorCallable. For use in theparseWithHandlermethods.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description RunAll()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 asRunnableorCallable.
-
-
-
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 asRunnableorCallable. If any of theCommandLinecommands does not implement eitherRunnableorCallable, aExecutionExceptionis thrown detailing the problem and capturing the offendingCommandLineobject.- Specified by:
handleParseResultin interfaceCommandLine.IParseResultHandler- Parameters:
parsedCommands- theCommandLineobjects that resulted from successfully parsing the command line argumentsout- thePrintStreamto print help to if requestedansi- 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
Callablecommands,nullelements for commands that implementRunnable - Throws:
CommandLine.ExecutionException- if a problem occurred while processing the parse results; useCommandLine.ExecutionException.getCommandLine()to get the command or subcommand where processing failed
-
-