public class Cli extends Object
CliOptions
annotations, from which Apache Commons
CLI Options
objects are derived.Modifier and Type | Method and Description |
---|---|
static org.apache.commons.cli.CommandLine |
createCommandLine(Class<?> clazz,
String[] args)
Creates a
CommandLine . |
static String |
createHelp(Class<?> clazz)
Creates a help string.
|
protected static org.apache.commons.cli.Options |
createOptions(Class<?> clazz)
Creates a set of
Option s. |
public static org.apache.commons.cli.CommandLine createCommandLine(Class<?> clazz, String[] args) throws org.apache.commons.cli.ParseException
CommandLine
.clazz
- the class annotated with CliOptions
.org.apache.commons.cli.ParseException
- when the command-line arguments couldn't be parsed.public static String createHelp(Class<?> clazz)
clazz
- the class annotated with CliOptions
.protected static org.apache.commons.cli.Options createOptions(Class<?> clazz)
Option
s.clazz
- the class annotated with CliOptions
.