Package | Description |
---|---|
org.apache.logging.log4j.core.tools.picocli |
Modifier and Type | Method and Description |
---|---|
CommandLine |
CommandLine.addSubcommand(String name,
Object command)
Registers a subcommand with the specified name.
|
CommandLine |
CommandLine.ExecutionException.getCommandLine()
Returns the
CommandLine object for the (sub)command that could not be invoked. |
CommandLine |
CommandLine.ParameterException.getCommandLine()
Returns the
CommandLine object for the (sub)command whose input could not be parsed. |
CommandLine |
CommandLine.getParent()
Returns the command that this is a subcommand of, or
null if this is a top-level command. |
<K> CommandLine |
CommandLine.registerConverter(Class<K> cls,
CommandLine.ITypeConverter<K> converter)
Registers the specified type converter for the specified class.
|
CommandLine |
CommandLine.setCommandName(String commandName)
Sets the command name (also called program name) displayed in the usage help synopsis to the specified value.
|
CommandLine |
CommandLine.setOverwrittenOptionsAllowed(boolean newValue)
Sets whether options for single-value fields can be specified multiple times on the command line without a
CommandLine.OverwrittenOptionException being thrown. |
CommandLine |
CommandLine.setSeparator(String separator)
Sets the String the parser uses to separate option names from option values to the specified value.
|
CommandLine |
CommandLine.setUnmatchedArgumentsAllowed(boolean newValue)
Sets whether the end user may specify unmatched arguments on the command line without a
CommandLine.UnmatchedArgumentException being thrown. |
Modifier and Type | Method and Description |
---|---|
Map<String,CommandLine> |
CommandLine.getSubcommands()
Returns a map with the subcommands registered on this instance.
|
List<CommandLine> |
CommandLine.parse(String... args)
Parses the specified command line arguments and returns a list of
CommandLine objects representing the
top-level command and any subcommands (if any) that were recognized and initialized during the parsing process. |
Modifier and Type | Method and Description |
---|---|
CommandLine.Help |
CommandLine.Help.addAllSubcommands(Map<String,CommandLine> commands)
Registers all specified subcommands with this Help.
|
List<Object> |
CommandLine.IParseResultHandler.handleParseResult(List<CommandLine> parsedCommands,
PrintStream out,
CommandLine.Help.Ansi ansi)
Processes a List of
CommandLine objects resulting from successfully
parsing the command line arguments and optionally returns a list of results. |
List<Object> |
CommandLine.RunFirst.handleParseResult(List<CommandLine> parsedCommands,
PrintStream out,
CommandLine.Help.Ansi ansi)
Prints help if requested, and otherwise executes the top-level
Runnable or Callable command. |
List<Object> |
CommandLine.RunLast.handleParseResult(List<CommandLine> parsedCommands,
PrintStream out,
CommandLine.Help.Ansi ansi)
Prints help if requested, and otherwise executes the most specific
Runnable or Callable subcommand. |
List<Object> |
CommandLine.RunAll.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 . |
static boolean |
CommandLine.printHelpIfRequested(List<CommandLine> parsedCommands,
PrintStream out,
CommandLine.Help.Ansi ansi)
Helper method that may be useful when processing the list of
CommandLine objects that result from successfully
parsing command line arguments. |
Copyright © 1999-2021 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.