Package | Description |
---|---|
org.apache.logging.log4j.core.tools.picocli |
Modifier and Type | Field and Description |
---|---|
private CommandLine |
CommandLine.ExecutionException.commandLine |
private CommandLine |
CommandLine.ParameterException.commandLine |
private CommandLine |
CommandLine.parent |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,CommandLine> |
CommandLine.Interpreter.commands |
Modifier and Type | Method and Description |
---|---|
CommandLine |
CommandLine.addSubcommand(java.lang.String name,
java.lang.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(java.lang.Class<K> cls,
CommandLine.ITypeConverter<K> converter)
Registers the specified type converter for the specified class.
|
CommandLine |
CommandLine.setCommandName(java.lang.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(java.lang.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. |
private static CommandLine |
CommandLine.toCommandLine(java.lang.Object obj) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,CommandLine> |
CommandLine.getSubcommands()
Returns a map with the subcommands registered on this instance.
|
java.util.List<CommandLine> |
CommandLine.parse(java.lang.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. |
(package private) java.util.List<CommandLine> |
CommandLine.Interpreter.parse(java.lang.String... args)
Entry point into parsing command line arguments.
|
Modifier and Type | Method and Description |
---|---|
private static CommandLine.MissingParameterException |
CommandLine.MissingParameterException.create(CommandLine cmd,
java.util.Collection<java.lang.reflect.Field> missing,
java.lang.String separator) |
private static CommandLine.ParameterException |
CommandLine.ParameterException.create(CommandLine cmd,
java.lang.Exception ex,
java.lang.String arg,
int i,
java.lang.String[] args) |
private static java.lang.Object |
CommandLine.execute(CommandLine parsed) |
Modifier and Type | Method and Description |
---|---|
CommandLine.Help |
CommandLine.Help.addAllSubcommands(java.util.Map<java.lang.String,CommandLine> commands)
Registers all specified subcommands with this Help.
|
java.util.List<java.lang.Object> |
CommandLine.IParseResultHandler.handleParseResult(java.util.List<CommandLine> parsedCommands,
java.io.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. |
java.util.List<java.lang.Object> |
CommandLine.RunFirst.handleParseResult(java.util.List<CommandLine> parsedCommands,
java.io.PrintStream out,
CommandLine.Help.Ansi ansi)
Prints help if requested, and otherwise executes the top-level
Runnable or Callable command. |
java.util.List<java.lang.Object> |
CommandLine.RunLast.handleParseResult(java.util.List<CommandLine> parsedCommands,
java.io.PrintStream out,
CommandLine.Help.Ansi ansi)
Prints help if requested, and otherwise executes the most specific
Runnable or Callable subcommand. |
java.util.List<java.lang.Object> |
CommandLine.RunAll.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 . |
private void |
CommandLine.Interpreter.parse(java.util.List<CommandLine> parsedCommands,
java.util.Stack<java.lang.String> argumentStack,
java.lang.String[] originalArgs) |
static boolean |
CommandLine.printHelpIfRequested(java.util.List<CommandLine> parsedCommands,
java.io.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. |
private void |
CommandLine.Interpreter.processArguments(java.util.List<CommandLine> parsedCommands,
java.util.Stack<java.lang.String> args,
java.util.Collection<java.lang.reflect.Field> required,
java.util.Set<java.lang.reflect.Field> initialized,
java.lang.String[] originalArgs) |
Constructor and Description |
---|
ExecutionException(CommandLine commandLine,
java.lang.String msg) |
ExecutionException(CommandLine commandLine,
java.lang.String msg,
java.lang.Exception ex) |
MaxValuesforFieldExceededException(CommandLine commandLine,
java.lang.String msg) |
MissingParameterException(CommandLine commandLine,
java.lang.String msg) |
MissingTypeConverterException(CommandLine commandLine,
java.lang.String msg) |
OverwrittenOptionException(CommandLine commandLine,
java.lang.String msg) |
ParameterException(CommandLine commandLine,
java.lang.String msg)
Constructs a new ParameterException with the specified CommandLine and error message.
|
ParameterException(CommandLine commandLine,
java.lang.String msg,
java.lang.Exception ex)
Constructs a new ParameterException with the specified CommandLine and error message.
|
UnmatchedArgumentException(CommandLine commandLine,
java.util.List<java.lang.String> args) |
UnmatchedArgumentException(CommandLine commandLine,
java.util.Stack<java.lang.String> args) |
UnmatchedArgumentException(CommandLine commandLine,
java.lang.String msg) |