|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CliParser
This is the interface used to parse the
command-line arguments of a main-program.
CliClass| Field Summary | |
|---|---|
static char |
CHAR_OPTION
The option prefix character. |
static String |
END_OPTIONS
The argument used to indicate that options are complete
and arguments will follow. |
static String |
PREFIX_LONG_OPTION
The prefix for name or alias of a long option. |
static String |
PREFIX_SHORT_OPTION
The prefix for name or alias of a short option. |
| Method Summary | |
|---|---|
CliModeObject |
parseParameters(String... parameters)
This method parses the given command-line parameters and applies the parsed options and arguments to the
Pojo that was supplied when
building this parser. |
void |
printHelp(Appendable target)
This method prints the help (program usage) generated from the annotations to the given Appendable using default settings. |
void |
printHelp(Appendable target,
CliOutputSettings settings)
This method prints the help (program usage) generated from the annotations to the given Appendable using the given settings. |
| Field Detail |
|---|
static final char CHAR_OPTION
PREFIX_SHORT_OPTION,
PREFIX_LONG_OPTION,
Constant Field Valuesstatic final String PREFIX_SHORT_OPTION
name or alias of a short option. Value is "-" (e.g. "-h").
static final String PREFIX_LONG_OPTION
name or alias of a long option. Value is "--" (e.g. "--help").
static final String END_OPTIONS
options are complete
and arguments will follow. This allows to specify an
argument that is equal to an option (e.g. "cat -- --help" would print the
contents of a file named "--help" rather that printing the help usage
output).
| Method Detail |
|---|
void printHelp(Appendable target)
Appendable using default settings.
target - is the Appendable where to print to.printHelp(Appendable, CliOutputSettings)
void printHelp(Appendable target,
CliOutputSettings settings)
Appendable using the given settings.
target - is the Appendable where to print to.settings - are the CliOutputSettings used to configure the
output.
CliModeObject parseParameters(String... parameters)
throws CliException
options and arguments to the
Pojo that was supplied when
building this parser.
parameters - are the command-line arguments of the main-program.
mode that was triggered.
CliException - if the given arguments are invalid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||