@rushstack/ts-command-line
Advanced tools
Comparing version 4.18.0 to 4.18.1
@@ -244,2 +244,4 @@ /** | ||
readonly environmentVariable: string | undefined; | ||
/** {@inheritDoc IBaseCommandLineDefinition.allowNonStandardEnvironmentVariableNames} */ | ||
readonly allowNonStandardEnvironmentVariableNames: boolean | undefined; | ||
/** {@inheritDoc IBaseCommandLineDefinition.undocumentedSynonyms } */ | ||
@@ -773,3 +775,5 @@ readonly undocumentedSynonyms: string[] | undefined; | ||
* The environment variable name must consist only of upper-case letters, numbers, | ||
* and underscores. It may not start with a number. | ||
* and underscores. It may not start with a number. To disable this validation, set | ||
* `{@link IBaseCommandLineDefinition.allowNonStandardEnvironmentVariableNames}` | ||
* to `true`. | ||
* | ||
@@ -803,2 +807,15 @@ * This feature cannot be used when {@link IBaseCommandLineDefinition.required} is true, | ||
/** | ||
* Allows for the use of environment variable names that do not conform to the standard | ||
* described by the Shell and Utilities volume of IEEE Std 1003.1-2001. This disables | ||
* the validation that is performed on the provided | ||
* {@link IBaseCommandLineDefinition.environmentVariable} value by default. | ||
* | ||
* @remarks | ||
* if this is set to `true`, environment variable discovery will vary based on the | ||
* platform in use. For example, Windows environment variable names are case-insensitive, | ||
* while on Linux, environment variable names are case-sensitive. It is recommended that | ||
* this option be used only when necessary based on environmental constraints. | ||
*/ | ||
allowNonStandardEnvironmentVariableNames?: boolean; | ||
/** | ||
* Specifies additional names for this parameter that are accepted but not displayed | ||
@@ -805,0 +822,0 @@ * in the command line help. |
@@ -51,2 +51,4 @@ import type { SCOPING_PARAMETER_GROUP } from '../Constants'; | ||
readonly environmentVariable: string | undefined; | ||
/** {@inheritDoc IBaseCommandLineDefinition.allowNonStandardEnvironmentVariableNames} */ | ||
readonly allowNonStandardEnvironmentVariableNames: boolean | undefined; | ||
/** {@inheritDoc IBaseCommandLineDefinition.undocumentedSynonyms } */ | ||
@@ -53,0 +55,0 @@ readonly undocumentedSynonyms: string[] | undefined; |
@@ -90,3 +90,4 @@ "use strict"; | ||
} | ||
if (!ENVIRONMENT_VARIABLE_NAME_REGEXP.test(this.environmentVariable)) { | ||
if (!this.allowNonStandardEnvironmentVariableNames && | ||
!ENVIRONMENT_VARIABLE_NAME_REGEXP.test(this.environmentVariable)) { | ||
throw new Error(`Invalid environment variable name: "${this.environmentVariable}". The name must` + | ||
@@ -93,0 +94,0 @@ ` consist only of upper-case letters, numbers, and underscores. It may not start with a number.`); |
@@ -42,3 +42,5 @@ import type { SCOPING_PARAMETER_GROUP } from '../Constants'; | ||
* The environment variable name must consist only of upper-case letters, numbers, | ||
* and underscores. It may not start with a number. | ||
* and underscores. It may not start with a number. To disable this validation, set | ||
* `{@link IBaseCommandLineDefinition.allowNonStandardEnvironmentVariableNames}` | ||
* to `true`. | ||
* | ||
@@ -72,2 +74,15 @@ * This feature cannot be used when {@link IBaseCommandLineDefinition.required} is true, | ||
/** | ||
* Allows for the use of environment variable names that do not conform to the standard | ||
* described by the Shell and Utilities volume of IEEE Std 1003.1-2001. This disables | ||
* the validation that is performed on the provided | ||
* {@link IBaseCommandLineDefinition.environmentVariable} value by default. | ||
* | ||
* @remarks | ||
* if this is set to `true`, environment variable discovery will vary based on the | ||
* platform in use. For example, Windows environment variable names are case-insensitive, | ||
* while on Linux, environment variable names are case-sensitive. It is recommended that | ||
* this option be used only when necessary based on environmental constraints. | ||
*/ | ||
allowNonStandardEnvironmentVariableNames?: boolean; | ||
/** | ||
* Specifies additional names for this parameter that are accepted but not displayed | ||
@@ -74,0 +89,0 @@ * in the command line help. |
{ | ||
"name": "@rushstack/ts-command-line", | ||
"version": "4.18.0", | ||
"version": "4.18.1", | ||
"description": "An object-oriented command-line parser for TypeScript", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
457313
4966