Class CLIParser
- java.lang.Object
-
- gov.nist.secauto.decima.module.cli.CLIParser
-
public class CLIParser extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_VALIDATION_REPORT_FILE
static String
DEFAULT_VALIDATION_RESULT_FILE
static String
OPTION_VALIDATION_REPORT_FILE
static String
OPTION_VALIDATION_RESULT_FILE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CLIParser
addOption(OptionValidator validator)
Adds an CLI option with a coupledOptionValidator
.CLIParser
addOption(org.apache.commons.cli.Option option)
CLIParser
addOptionGroup(org.apache.commons.cli.OptionGroup group)
void
doShowHelp()
protected org.apache.commons.cli.CommandLine
doShowVersion(org.apache.commons.cli.CommandLine cmd)
protected org.apache.commons.cli.Options
getOptions()
String
getVersion()
protected void
initializeStandardOptions()
org.apache.commons.cli.CommandLine
parse(String[] arguments)
Parses the command line options provided by a main(String) method.void
setVersion(String version)
-
-
-
Field Detail
-
OPTION_VALIDATION_RESULT_FILE
public static final String OPTION_VALIDATION_RESULT_FILE
- See Also:
- Constant Field Values
-
OPTION_VALIDATION_REPORT_FILE
public static final String OPTION_VALIDATION_REPORT_FILE
- See Also:
- Constant Field Values
-
DEFAULT_VALIDATION_RESULT_FILE
public static final String DEFAULT_VALIDATION_RESULT_FILE
- See Also:
- Constant Field Values
-
DEFAULT_VALIDATION_REPORT_FILE
public static final String DEFAULT_VALIDATION_REPORT_FILE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CLIParser
public CLIParser(String cmdLineSyntax)
-
-
Method Detail
-
getVersion
public String getVersion()
-
setVersion
public void setVersion(String version)
-
initializeStandardOptions
protected void initializeStandardOptions()
-
getOptions
protected org.apache.commons.cli.Options getOptions()
-
addOption
public CLIParser addOption(OptionValidator validator)
Adds an CLI option with a coupledOptionValidator
.- Parameters:
validator
- the option validator related to the option to add- Returns:
- the current class instance
-
addOption
public CLIParser addOption(org.apache.commons.cli.Option option)
-
addOptionGroup
public CLIParser addOptionGroup(org.apache.commons.cli.OptionGroup group)
-
parse
public org.apache.commons.cli.CommandLine parse(String[] arguments) throws org.apache.commons.cli.ParseException
Parses the command line options provided by a main(String) method.- Parameters:
arguments
- the arguments to parse- Returns:
- a
CommandLine
object representing the parsed command line arguments - Throws:
org.apache.commons.cli.ParseException
- if an error occurred while parsing CLI arguments
-
doShowVersion
protected org.apache.commons.cli.CommandLine doShowVersion(org.apache.commons.cli.CommandLine cmd)
-
doShowHelp
public void doShowHelp()
-
-