java.lang.Object
com.github.rvesse.airline.Cli<C>
- Type Parameters:
C
- Command type
Class for encapsulating and parsing CLIs
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CliBuilder
<T> Creates a builder for specifying a command line in fluent styleGets the global meta-dataprivate C
Parses the arguments to produce a command instance, this may benull
if the arguments don't identify a command and there was no appropriate default command configuredParses the arguments to produce a command instance, this may benull
if the arguments don't identify a command and there was no appropriate default command configuredparseWithResult
(Iterable<String> args) Parses the arguments to produce a result.parseWithResult
(String... args) Parses the arguments to produce a result.
-
Field Details
-
metadata
-
-
Constructor Details
-
Cli
Creates a new CLI from a class annotated with theCli
annotation- Parameters:
cliClass
- CLI class
-
Cli
Creates a new CLI from a class annotated with theCli
annotation- Parameters:
cliClass
- CLI classparserConfig
- Parser configuration, this will override any configuration specified by theCli.parserConfiguration()
field
-
Cli
Creates a new CLI- Parameters:
metadata
- Metadata
-
-
Method Details
-
builder
Creates a builder for specifying a command line in fluent style- Type Parameters:
T
- Command type to be built- Parameters:
name
- Program name- Returns:
- CLI Builder
-
getMetadata
Gets the global meta-data- Returns:
- Meta-data
-
parse
Parses the arguments to produce a command instance, this may benull
if the arguments don't identify a command and there was no appropriate default command configured- Parameters:
args
- Arguments- Returns:
- Command instance
-
parse
Parses the arguments to produce a command instance, this may benull
if the arguments don't identify a command and there was no appropriate default command configured- Parameters:
args
- Arguments- Returns:
- Command instance
-
parseWithResult
Parses the arguments to produce a result. The result can be inspected to see errors (assuming a suitable error handler was used e.g.CollectAll
) and to get a command instance. This may benull
if the arguments don't identify a command and there was no appropriate default command configured- Parameters:
args
- Arguments- Returns:
- Parse result
-
parseWithResult
Parses the arguments to produce a result. The result can be inspected to see errors (assuming a suitable error handler was used e.g.CollectAll
) and to get a command instance. This may benull
if the arguments don't identify a command and there was no appropriate default command configured- Parameters:
args
- Arguments- Returns:
- Parse result
-