Package io.micronaut.core.cli
Interface CommandLine.Builder<T extends CommandLine.Builder>
- Type Parameters:
T
- The concrete type of the builder
- Enclosing interface:
- CommandLine
public static interface CommandLine.Builder<T extends CommandLine.Builder>
A build for constructing a command line parser.
-
Method Summary
Modifier and TypeMethodDescriptionAdd an option.Parses the given list of command line arguments.parseString
(String string) Parses a string of all the command line options converting them into an array of arguments to pass to #parse(String..args).
-
Method Details
-
addOption
Add an option.- Parameters:
name
- The namedescription
- The description- Returns:
- This builder
-
parseString
Parses a string of all the command line options converting them into an array of arguments to pass to #parse(String..args).- Parameters:
string
- The string- Returns:
- The command line
-
parse
Parses the given list of command line arguments. Arguments starting with -D become system properties, arguments starting with -- or - become either declared or undeclared options. All other arguments are put into a list of remaining arguments- Parameters:
args
- The arguments- Returns:
- The command line state
-