public final class Options extends Object
main(String[]).
For example:
public class MyApp {
public void main(String[] args) {
Options options = Options.parse(ClassLoader.getSystemClassLoader().getResource("cli.xml"), MyApp.class, args);
...
}
}
| Modifier and Type | Method and Description |
|---|---|
String[] |
getArguments() |
String |
getOption(String name) |
Collection<Option> |
getOptions() |
String[] |
getOptions(String name) |
static Options |
parse(org.openjax.cli_1_1_7.Cli binding,
String[] args)
Parses
args as per the CLI XML specification in the provided
Cli JAXB binding. |
static Options |
parse(File cliFile,
String[] args)
Parses
args as per the CLI XML specification at the provided
File. |
static Options |
parse(URL cliURL,
String[] args)
Parses
args as per the CLI XML specification at the provided
URL. |
void |
printCommand(PrintStream ps,
Class<?> callerClass) |
String |
toString() |
public static Options parse(File cliFile, String[] args) throws IOException
args as per the CLI XML specification at the provided
File.cliFile - The File pointing to the CLI XML.args - The main(String[] args).Options.IOException - If an I/O error has occurred.public static Options parse(URL cliURL, String[] args) throws IOException
args as per the CLI XML specification at the provided
URL.cliURL - The URL pointing to the CLI XML.args - The main(String[] args).Options.IOException - If an I/O error has occurred.public static Options parse(org.openjax.cli_1_1_7.Cli binding, String[] args)
args as per the CLI XML specification in the provided
Cli JAXB binding.binding - The Cli JAXB binding representing the CLI XML.args - The main(String[] args).Options.public String[] getArguments()
null in case there are no unnamed arguments.public Collection<Option> getOptions()
public void printCommand(PrintStream ps, Class<?> callerClass)
Copyright © 2019 OpenJAX. All rights reserved.