public static class CommandLine.RunAll extends Object implements CommandLine.IParseResultHandler
Runnable
or Callable
.
For use in the parseWithHandler
methods.Constructor and Description |
---|
RunAll() |
Modifier and Type | Method and Description |
---|---|
List<Object> |
handleParseResult(List<CommandLine> parsedCommands,
PrintStream out,
CommandLine.Help.Ansi ansi)
Prints help if requested, and otherwise executes the top-level command and all subcommands as
Runnable
or Callable . |
public List<Object> handleParseResult(List<CommandLine> parsedCommands, PrintStream out, CommandLine.Help.Ansi ansi)
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.handleParseResult
in interface CommandLine.IParseResultHandler
parsedCommands
- the CommandLine
objects that resulted from successfully parsing the command line argumentsout
- the PrintStream
to print help to if requestedansi
- for printing help messages using ANSI styles and colorsCallable
commands, null
elements for commands that implement Runnable
CommandLine.ExecutionException
- if a problem occurred while processing the parse results; use
CommandLine.ExecutionException.getCommandLine()
to get the command or subcommand where processing failed Copyright © 1999-2023 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.