public class CliParser
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CliParser.Argument
Representation of a command line argument.
|
static class |
CliParser.ArgumentMap |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<CliParser.Argument> |
m_arguments |
| Constructor and Description |
|---|
CliParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
addArgument(CliParser.Argument a)
Adds a command-line argument to the parser
|
CliParser.ArgumentMap |
parse(java.lang.String[] cli)
Parses an array of command-line arguments and returns the result
|
void |
printHelp(java.lang.String header,
java.io.PrintStream out)
Prints the usage of each command line switch
|
protected java.util.Set<CliParser.Argument> m_arguments
public void addArgument(CliParser.Argument a)
a - The argumentpublic CliParser.ArgumentMap parse(java.lang.String[] cli)
cli - The array of strings (typically, the args
argument from main()null if the parsing failedpublic void printHelp(java.lang.String header,
java.io.PrintStream out)
header - A string to display before the helpout - The print stream to send the output to (typically
System.out or System.errCopyright © Sylvain HallĂ©. All Rights Reserved.