Class Argument
java.lang.Object
org.apache.geode.modules.session.installer.args.Argument
Class representing a single command line argument.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a possible representation of the command line argument.Returns the primary form of the argument.booleanReturns whether or not this argument is required to be defined.setArgumentHandler(ArgumentHandler aHandler) Sets the argument handler.setDefaults(String... newDefaults) Sets the default values when no explicit values were provided.setDescription(String str) Sets a usage description for this argument.setEnvVars(String... newEnvVars) Sets the environment variables which will be checked for values before falling back on the default values.toString()Returns a human readable form.
-
Constructor Details
-
Argument
Contructor to create an argument definition.- Parameters:
primaryForm- the form of the argument (e.g., --foo). Should start with a dash.argRequired- flag indicating whether or not the argument is required to be onthe command lineparameterNames- names of the parameters to this argument for use in the usage generation
-
-
Method Details
-
isRequired
public boolean isRequired()Returns whether or not this argument is required to be defined.- Returns:
- true if required, false if optional
-
setArgumentHandler
Sets the argument handler.- Parameters:
aHandler- argument handler- Returns:
- this argument (for chained calls)
-
addForm
Adds a possible representation of the command line argument.- Parameters:
aliasName- additional form to accept- Returns:
- this argument (for chained calls)
-
getPrimaryForm
Returns the primary form of the argument.- Returns:
- primary form
-
setDescription
Sets a usage description for this argument.- Parameters:
str- usage description- Returns:
- this argument (for chained calls)
-
setDefaults
Sets the default values when no explicit values were provided.- Parameters:
newDefaults- default values for all argument parameters- Returns:
- this argument (for chained calls)
-
setEnvVars
Sets the environment variables which will be checked for values before falling back on the default values.- Parameters:
newEnvVars- environment variable name array- Returns:
- this argument (for chained calls)
-
toString
Returns a human readable form.
-