Package nz.org.riskscape.picocli
Class CommandLine.ParseResult.Builder
java.lang.Object
nz.org.riskscape.picocli.CommandLine.ParseResult.Builder
- Enclosing class:
- CommandLine.ParseResult
Builds immutable
ParseResult instances.-
Method Summary
Modifier and TypeMethodDescriptionadd(CommandLine.Model.ArgSpec arg, int position) Adds the specifiedOptionSpecorPositionalParamSpecto the list of options and parameters that were matched on the command line.voidAdds the specifiedOptionSpecto the list of options that were matched on the command line.addPositionalParam(CommandLine.Model.PositionalParamSpec positionalParam, int position) Adds the specifiedPositionalParamSpecto the list of parameters that were matched on the command line.addUnmatched(String arg) Adds the specified command line argument to the list of unmatched command line arguments.addUnmatched(Stack<String> args) Adds all elements of the specified command line arguments stack to the list of unmatched command line arguments.build()Creates and returns a newParseResultinstance for this builder's configuration.originalArgs(String[] originalArgs) Sets the specified command line arguments that were parsed.subcommand(CommandLine.ParseResult subcommand) Sets the specifiedParseResultfor a subcommand that was matched on the command line.
-
Method Details
-
build
Creates and returns a newParseResultinstance for this builder's configuration. -
add
Adds the specifiedOptionSpecorPositionalParamSpecto the list of options and parameters that were matched on the command line.- Parameters:
arg- the matchedOptionSpecorPositionalParamSpecposition- the command line position at which thePositionalParamSpecwas matched. Ignored forOptionSpecs.- Returns:
- this builder for method chaining
-
addOption
Adds the specifiedOptionSpecto the list of options that were matched on the command line. -
addPositionalParam
public CommandLine.ParseResult.Builder addPositionalParam(CommandLine.Model.PositionalParamSpec positionalParam, int position) Adds the specifiedPositionalParamSpecto the list of parameters that were matched on the command line.- Parameters:
positionalParam- the matchedPositionalParamSpecposition- the command line position at which thePositionalParamSpecwas matched.- Returns:
- this builder for method chaining
-
addUnmatched
Adds the specified command line argument to the list of unmatched command line arguments. -
addUnmatched
Adds all elements of the specified command line arguments stack to the list of unmatched command line arguments. -
subcommand
Sets the specifiedParseResultfor a subcommand that was matched on the command line. -
originalArgs
Sets the specified command line arguments that were parsed. -
addError
-