public class CommandLine extends Object
Constructor and Description |
---|
CommandLine(Reporter reporter) |
Modifier and Type | Method and Description |
---|---|
void |
assignOptionValue(Map<String,Object> options,
Method m,
List<String> args,
boolean last)
Assign an option, must handle flags, parameters, and parameters that can
happen multiple times.
|
String |
execute(Object target,
String cmd,
List<String> input)
Execute a command in a target object with a set of options and arguments
and returns help text if something fails.
|
void |
generateDocumentation(Object target,
Appendable out) |
Map<String,Method> |
getCommands(Object target)
Parse a class and return a list of command names
|
<T extends Options> |
getOptions(Class<T> specification,
List<String> arguments)
Parse the options in a command line and return an interface that provides
the options from this command line.
|
Object |
getResult() |
void |
help(Formatter f,
Object target)
Show all commands in a target
|
void |
help(Formatter f,
Object target,
String cmd)
Show the full help for a given command
|
void |
help(Formatter f,
Object target,
String cmd,
Class<? extends Options> specification)
Provide a help text.
|
String |
subCmd(Options opts,
Object target) |
public CommandLine(Reporter reporter)
public String execute(Object target, String cmd, List<String> input) throws Exception
Exception
public void generateDocumentation(Object target, Appendable out)
public <T extends Options> T getOptions(Class<T> specification, List<String> arguments) throws Exception
Exception
public void assignOptionValue(Map<String,Object> options, Method m, List<String> args, boolean last)
options
- The command line mapargs
- the args inputm
- the selected method for this optionlast
- if this is the last in a multi single character optionpublic void help(Formatter f, Object target, String cmd, Class<? extends Options> specification)
public void help(Formatter f, Object target) throws Exception
Exception
public void help(Formatter f, Object target, String cmd)
public Map<String,Method> getCommands(Object target)
target
- public Object getResult()
Copyright © 2021 aQute SARL. All rights reserved.