Package net.shibboleth.metadata.cli
Class SimpleCommandLineArguments
java.lang.Object
net.shibboleth.metadata.cli.SimpleCommandLineArguments
Command line arguments for the
SimpleCommandLine command line tool.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanHelp has been requested.private StringProvided input file name for the Spring configuration file.private StringName of a specific logging configuration, if one has been requested.Command-line arguments which are not part of options.private StringProvided name for the pipeline bean to execute.private booleanQuiet logging has been requested.private booleanVerbose logging has been requested.private booleanVersion has been requested. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandoHelp()Indicates the presence of the--helpoption.booleanIndicates the presence of the--quietoption.booleanIndicates the presence of the--verboseoption.booleanIndicates the presence of the--versionoption.private voiderrorAndExit(String error) Prints the error message to STDERR and then exits.Gets the parsed input file name from the command line.Gets the name of the requested logging configuration file from the command line.Returns the name of the pipeline bean to execute from the command line.voidparseCommandLineArguments(String[] args) Parse an array of command-line arguments as passed to the main program.voidprintHelp(PrintStream out) Print command line help instructions.private voidValidate the provided command line arguments, for example issuing an error if they are inconsistent.
-
Field Details
-
otherArgs
Command-line arguments which are not part of options. -
inFile
Provided input file name for the Spring configuration file. -
pipelineName
Provided name for the pipeline bean to execute. -
verbose
private boolean verboseVerbose logging has been requested. -
quiet
private boolean quietQuiet logging has been requested. -
logConfig
Name of a specific logging configuration, if one has been requested. -
help
private boolean helpHelp has been requested. -
version
private boolean versionVersion has been requested.
-
-
Constructor Details
-
SimpleCommandLineArguments
public SimpleCommandLineArguments()
-
-
Method Details
-
parseCommandLineArguments
Parse an array of command-line arguments as passed to the main program.- Parameters:
args- array of command-line arguments to parse.
-
getInputFile
Gets the parsed input file name from the command line.- Returns:
- the input file name argument
-
getPipelineName
Returns the name of the pipeline bean to execute from the command line.- Returns:
- the pipeline bean name argument
-
doVerboseOutput
public boolean doVerboseOutput()Indicates the presence of the--verboseoption.- Returns:
trueif the user requested verbose logging.
-
doQuietOutput
public boolean doQuietOutput()Indicates the presence of the--quietoption.- Returns:
trueif the user requested quiet logging.
-
getLoggingConfiguration
Gets the name of the requested logging configuration file from the command line.- Returns:
- the logging configuration file name, or
null.
-
doHelp
public boolean doHelp()Indicates the presence of the--helpoption.- Returns:
trueif the user requested help.
-
doVersion
public boolean doVersion()Indicates the presence of the--versionoption.- Returns:
trueif the user requested the version be printed.
-
validateCommandLineArguments
private void validateCommandLineArguments()Validate the provided command line arguments, for example issuing an error if they are inconsistent. -
printHelp
Print command line help instructions.- Parameters:
out- location where to print the output
-
errorAndExit
Prints the error message to STDERR and then exits.- Parameters:
error- the error message
-