Class Cli<C>
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 CParses the arguments to produce a command instance, this may benullif the arguments don't identify a command and there was no appropriate default command configuredParses the arguments to produce a command instance, this may benullif 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
-
Cli
Creates a new CLI from a class annotated with theCliannotation- Parameters:
cliClass- CLI classparserConfig- Parser configuration, this will override any configuration specified by theCli.parserConfiguration()field
-
Cli
-
-
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
-
parse
-
parse
-
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 benullif 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 benullif the arguments don't identify a command and there was no appropriate default command configured- Parameters:
args- Arguments- Returns:
- Parse result
-