public class CommandLineParser extends Object
CommandLine
It can also print a formatted usage/help information.Constructor and Description |
---|
CommandLineParser(List<ParameterInt> parameters) |
CommandLineParser(ParameterInt parameterInt) |
CommandLineParser(String name,
String usage) |
Modifier and Type | Method and Description |
---|---|
void |
addParameter(ParameterInt param) |
List<ParameterInt> |
getParameters() |
CommandLine |
parse(String line)
Parse a command line with the defined parameter as base of the rules.
|
CommandLine |
parse(String line,
boolean ignoreMissingRequirements)
Parse a command line with the defined parameter as base of the rules.
|
String |
printHelp()
Returns a usage String based on the defined parameter and options.
|
public CommandLineParser(List<ParameterInt> parameters)
public CommandLineParser(ParameterInt parameterInt)
public void addParameter(ParameterInt param)
public List<ParameterInt> getParameters()
public String printHelp()
public CommandLine parse(String line) throws IllegalArgumentException
CommandLine
object where
they can be queried after.line
- inputIllegalArgumentException
public CommandLine parse(String line, boolean ignoreMissingRequirements) throws IllegalArgumentException
CommandLine
object where
they can be queried after.line
- inputignoreMissingRequirements
- if we should ignoreIllegalArgumentException
Copyright © 2016 JBoss by Red Hat. All rights reserved.