-/ mandates that options MUST start with either a dash or a slash.
Options can have values separated by whitespace.
Values can contain whitespace as long as they are single-quoted or double-quoted.
Otherwhise whitespace identifies the end of a value.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private final String | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | EnvironmentVariableDefaultProvider()
Creates a default provider reading the environment variable |
| public | EnvironmentVariableDefaultProvider(final String
The name of the environment variable to read (e. g. environmentVariableName, final String "JCOMMANDER_OPTS"). Must not be null.A set of characters used to indicate the start of an option (e. g. optionPrefixes)"-/" if option names may start with either dash or slash). Must not be null.Creates a default provider reading the specified environment variable using the specified prefixes pattern. |
| pack-priv | EnvironmentVariableDefaultProvider(final String
The name of the environment variable to read. May be environmentVariableName, final String null if the passed resolver doesn't use it (e. g. Unit Test).A set of characters used to indicate the start of an option (e. g. optionPrefixes, final Function<String, String> "-/" if option names may start with either dash or slash). Must not be null.Reads the value from the environment variable (e. g. resolver)System::getenv). Must not be null.For Unit Tests Only: Allows to mock the resolver, as Java cannot set environment variables. |
| Modifier and Type | Method and Description |
|---|---|
| public final String | getDefaultValueFor(final String
The name of the option as specified in the names() attribute
of the @Parameter option (e.g. "-file"). optionName)Implements com. |
| DEFAULT_PREFIXES_PATTERN | back to summary |
|---|---|
| private static final String DEFAULT_PREFIXES_PATTERN | |
| DEFAULT_VARIABLE_NAME | back to summary |
|---|---|
| private static final String DEFAULT_VARIABLE_NAME | |
| environmentVariableValue | back to summary |
|---|---|
| private final String environmentVariableValue | |
| optionPrefixesPattern | back to summary |
|---|---|
| private final String optionPrefixesPattern | |
| EnvironmentVariableDefaultProvider | back to summary |
|---|---|
| public EnvironmentVariableDefaultProvider() Creates a default provider reading the environment variable | |
| EnvironmentVariableDefaultProvider | back to summary |
|---|---|
| public EnvironmentVariableDefaultProvider(final String environmentVariableName, final String optionPrefixes) Creates a default provider reading the specified environment variable using the specified prefixes pattern. | |
| EnvironmentVariableDefaultProvider | back to summary |
|---|---|
| pack-priv EnvironmentVariableDefaultProvider(final String environmentVariableName, final String optionPrefixes, final Function<String, String> resolver) For Unit Tests Only: Allows to mock the resolver, as Java cannot set environment variables.
| |
| getDefaultValueFor | back to summary |
|---|---|
| public final String getDefaultValueFor(final String optionName) Implements com.
| |