C - Command typepublic class Cli<C> extends Object
| Constructor and Description |
|---|
Cli(Class<?> cliClass)
Creates a new CLI from a class annotated with the
Cli annotation |
Cli(Class<?> cliClass,
ParserMetadata<C> parserConfig)
Creates a new CLI from a class annotated with the
Cli annotation |
Cli(GlobalMetadata<C> metadata)
Creates a new CLI
|
| Modifier and Type | Method and Description |
|---|---|
static <T> CliBuilder<T> |
builder(String name)
Creates a builder for specifying a command line in fluent style
|
GlobalMetadata<C> |
getMetadata()
Gets the global meta-data
|
C |
parse(String... args)
Parses the arguments to produce a command instance, this may be
null if the arguments don't identify a command and there was no
appropriate default command configured |
ParseResult<C> |
parseWithResult(Iterable<String> args)
Parses the arguments to produce a result.
|
ParseResult<C> |
parseWithResult(String... args)
Parses the arguments to produce a result.
|
public Cli(Class<?> cliClass)
Cli annotationcliClass - CLI classpublic Cli(Class<?> cliClass, ParserMetadata<C> parserConfig)
Cli annotationcliClass - CLI classparserConfig - Parser configuration, this will override any configuration
specified by the
Cli.parserConfiguration()
fieldpublic Cli(GlobalMetadata<C> metadata)
metadata - Metadatapublic static <T> CliBuilder<T> builder(String name)
T - Command type to be builtname - Program namepublic GlobalMetadata<C> getMetadata()
public C parse(String... args)
null if the arguments don't identify a command and there was no
appropriate default command configuredargs - Argumentspublic ParseResult<C> parseWithResult(String... args)
CollectAll) and to get a command instance. This may be
null if the arguments don't identify a command and there was no
appropriate default command configuredargs - Argumentspublic ParseResult<C> parseWithResult(Iterable<String> args)
CollectAll) and to get a command instance. This may be
null if the arguments don't identify a command and there was no
appropriate default command configuredargs - ArgumentsCopyright © 2012–2022. All rights reserved.