public static class CommandLine.RunFirst extends Object implements CommandLine.IParseResultHandler
Runnable
or Callable
command.
For use in the parseWithHandler
methods.
From picocli v2.0, RunFirst
is used to implement the run
and call
convenience methods.
Constructor and Description |
---|
RunFirst() |
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
Runnable or Callable command. |
public RunFirst()
public List<Object> handleParseResult(List<CommandLine> parsedCommands, PrintStream out, CommandLine.Help.Ansi ansi)
Runnable
or Callable
command.
If the top-level command 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
, or a null
element if the top-level command was a Runnable
CommandLine.ExecutionException
- if a problem occurred while processing the parse results; use
CommandLine.ExecutionException.getCommandLine()
to get the command or subcommand where processing failedCopyright © 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.