public static class CommandLine.ParseResult.Builder extends Object
ParseResult
instances.Modifier and Type | Method and Description |
---|---|
CommandLine.ParseResult.Builder |
add(CommandLine.Model.ArgSpec arg,
int position)
Adds the specified
OptionSpec or PositionalParamSpec to the list of options and parameters
that were matched on the command line. |
void |
addError(CommandLine.PicocliException ex) |
CommandLine.ParseResult.Builder |
addOption(CommandLine.Model.OptionSpec option)
Adds the specified
OptionSpec to the list of options that were matched on the command line. |
CommandLine.ParseResult.Builder |
addPositionalParam(CommandLine.Model.PositionalParamSpec positionalParam,
int position)
Adds the specified
PositionalParamSpec to the list of parameters that were matched on the command line. |
CommandLine.ParseResult.Builder |
addUnmatched(Stack<String> args)
Adds all elements of the specified command line arguments stack to the list of unmatched command line arguments.
|
CommandLine.ParseResult.Builder |
addUnmatched(String arg)
Adds the specified command line argument to the list of unmatched command line arguments.
|
CommandLine.ParseResult |
build()
Creates and returns a new
ParseResult instance for this builder's configuration. |
CommandLine.ParseResult.Builder |
expandedArgs(Collection<String> expandedArgs)
Sets the specified command line arguments after @-files were expanded;
these are the arguments that were actually parsed.
|
CommandLine.ParseResult.Builder |
originalArgs(String[] originalArgs)
Sets the specified original command line arguments that were passed to the
CommandLine.parseArgs(String...) method, before @-file expansion. |
CommandLine.ParseResult.Builder |
subcommand(CommandLine.ParseResult subcommand)
Sets the specified
ParseResult for a subcommand that was matched on the command line. |
public CommandLine.ParseResult build()
ParseResult
instance for this builder's configuration.public CommandLine.ParseResult.Builder add(CommandLine.Model.ArgSpec arg, int position)
OptionSpec
or PositionalParamSpec
to the list of options and parameters
that were matched on the command line.arg
- the matched OptionSpec
or PositionalParamSpec
position
- the command line position at which the PositionalParamSpec
was matched. Ignored for OptionSpec
s.public CommandLine.ParseResult.Builder addOption(CommandLine.Model.OptionSpec option)
OptionSpec
to the list of options that were matched on the command line.public CommandLine.ParseResult.Builder addPositionalParam(CommandLine.Model.PositionalParamSpec positionalParam, int position)
PositionalParamSpec
to the list of parameters that were matched on the command line.positionalParam
- the matched PositionalParamSpec
position
- the command line position at which the PositionalParamSpec
was matched.public CommandLine.ParseResult.Builder addUnmatched(String arg)
public CommandLine.ParseResult.Builder addUnmatched(Stack<String> args)
public CommandLine.ParseResult.Builder subcommand(CommandLine.ParseResult subcommand)
ParseResult
for a subcommand that was matched on the command line.public CommandLine.ParseResult.Builder originalArgs(String[] originalArgs)
CommandLine.parseArgs(String...)
method, before @-file expansion.public CommandLine.ParseResult.Builder expandedArgs(Collection<String> expandedArgs)
originalArgs(String[])
,
CommandLine.ParseResult.expandedArgs()
public void addError(CommandLine.PicocliException ex)