@rushstack/ts-command-line 4.17.4 → 4.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ts-command-line.d.ts +109 -29
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/parameters/BaseClasses.d.ts +2 -0
- package/lib/parameters/BaseClasses.d.ts.map +1 -1
- package/lib/parameters/BaseClasses.js +2 -1
- package/lib/parameters/BaseClasses.js.map +1 -1
- package/lib/parameters/CommandLineChoiceListParameter.d.ts +5 -5
- package/lib/parameters/CommandLineChoiceListParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineChoiceListParameter.js +1 -1
- package/lib/parameters/CommandLineChoiceListParameter.js.map +1 -1
- package/lib/parameters/CommandLineChoiceParameter.d.ts +14 -7
- package/lib/parameters/CommandLineChoiceParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineChoiceParameter.js +2 -2
- package/lib/parameters/CommandLineChoiceParameter.js.map +1 -1
- package/lib/parameters/CommandLineDefinition.d.ts +32 -14
- package/lib/parameters/CommandLineDefinition.d.ts.map +1 -1
- package/lib/parameters/CommandLineDefinition.js.map +1 -1
- package/lib/parameters/CommandLineIntegerParameter.d.ts +8 -1
- package/lib/parameters/CommandLineIntegerParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineIntegerParameter.js +1 -1
- package/lib/parameters/CommandLineIntegerParameter.js.map +1 -1
- package/lib/parameters/CommandLineStringParameter.d.ts +8 -1
- package/lib/parameters/CommandLineStringParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineStringParameter.js +1 -1
- package/lib/parameters/CommandLineStringParameter.js.map +1 -1
- package/lib/providers/CommandLineParameterProvider.d.ts +42 -6
- package/lib/providers/CommandLineParameterProvider.d.ts.map +1 -1
- package/lib/providers/CommandLineParameterProvider.js +0 -28
- package/lib/providers/CommandLineParameterProvider.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineChoiceParameter.js","sourceRoot":"","sources":["../../src/parameters/CommandLineChoiceParameter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,+CAA+E;
|
|
1
|
+
{"version":3,"file":"CommandLineChoiceParameter.js","sourceRoot":"","sources":["../../src/parameters/CommandLineChoiceParameter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,+CAA+E;AAW/E;;;GAGG;AACH,MAAa,0BAA4D,SAAQ,kCAAoB;IAYnG,gBAAgB;IAChB,YAAmB,UAAiD;QAClE,KAAK,CAAC,UAAU,CAAC,CAAC;QAPZ,WAAM,GAAwB,SAAS,CAAC;QAS9C,IAAI,UAAU,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;QACJ,CAAC;QACD,IAAI,UAAU,CAAC,YAAY,IAAI,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAC/F,MAAM,IAAI,KAAK,CACb,gCAAgC,UAAU,CAAC,YAAY,GAAG;gBACxD,yCAAyC,UAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,CAChF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;IAC5C,CAAC;IAED,8CAA8C;IAC9C,IAAW,IAAI;QACb,OAAO,sCAAwB,CAAC,MAAM,CAAC;IACzC,CAAC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D,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,kBAAkB,CAAC,IAAI,CAAC,yBAAyB,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,mEAAmE;IAC5D,eAAe,CAAC,OAAiB;QACtC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF;AA7GD,gEA6GC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ICommandLineChoiceDefinition } from './CommandLineDefinition';\nimport { CommandLineParameter, CommandLineParameterKind } from './BaseClasses';\n\n/**\n * The data type returned by {@link CommandLineParameterProvider.(defineChoiceParameter:2)}.\n * @public\n */\nexport interface IRequiredCommandLineChoiceParameter<TChoice extends string = string>\n extends CommandLineChoiceParameter<TChoice> {\n value: TChoice;\n}\n\n/**\n * The data type returned by {@link CommandLineParameterProvider.(defineChoiceParameter:1)}.\n * @public\n */\nexport class CommandLineChoiceParameter<TChoice extends string = string> extends CommandLineParameter {\n /** {@inheritDoc ICommandLineChoiceDefinition.alternatives} */\n public readonly alternatives: ReadonlyArray<TChoice>;\n\n /** {@inheritDoc ICommandLineStringDefinition.defaultValue} */\n public readonly defaultValue: TChoice | undefined;\n\n private _value: TChoice | undefined = undefined;\n\n /** {@inheritDoc ICommandLineChoiceDefinition.completions} */\n public readonly completions: (() => Promise<TChoice[]>) | undefined;\n\n /** @internal */\n public constructor(definition: ICommandLineChoiceDefinition<TChoice>) {\n super(definition);\n\n if (definition.alternatives.length < 1) {\n throw new Error(\n `When defining a choice parameter, the alternatives list must contain at least one value.`\n );\n }\n if (definition.defaultValue && definition.alternatives.indexOf(definition.defaultValue) === -1) {\n throw new Error(\n `The specified default value \"${definition.defaultValue}\"` +\n ` is not one of the available options: ${definition.alternatives.toString()}`\n );\n }\n\n this.alternatives = definition.alternatives;\n this.defaultValue = definition.defaultValue;\n this.validateDefaultValue(!!this.defaultValue);\n this.completions = definition.completions;\n }\n\n /** {@inheritDoc CommandLineParameter.kind} */\n public get kind(): CommandLineParameterKind {\n return CommandLineParameterKind.Choice;\n }\n\n /**\n * {@inheritDoc CommandLineParameter._setValue}\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public _setValue(data: any): void {\n // abstract\n if (data !== null && data !== undefined) {\n if (typeof data !== 'string') {\n this.reportInvalidData(data);\n }\n this._value = data as TChoice;\n return;\n }\n\n if (this.environmentVariable !== undefined) {\n // Try reading the environment variable\n const environmentValue: string | undefined = process.env[this.environmentVariable];\n if (environmentValue !== undefined && environmentValue !== '') {\n if (!this.alternatives.includes(environmentValue as TChoice)) {\n const choices: string = '\"' + this.alternatives.join('\", \"') + '\"';\n throw new Error(\n `Invalid value \"${environmentValue}\" for the environment variable` +\n ` ${this.environmentVariable}. Valid choices are: ${choices}`\n );\n }\n\n this._value = environmentValue as TChoice;\n return;\n }\n }\n\n if (this.defaultValue !== undefined) {\n this._value = this.defaultValue;\n return;\n }\n\n this._value = undefined;\n }\n\n /**\n * {@inheritDoc CommandLineParameter._getSupplementaryNotes}\n * @internal\n */\n public _getSupplementaryNotes(supplementaryNotes: string[]): void {\n // virtual\n super._getSupplementaryNotes(supplementaryNotes);\n if (this.defaultValue !== undefined) {\n supplementaryNotes.push(`The default value is \"${this.defaultValue}\".`);\n }\n }\n\n /**\n * Returns the argument value for a choice parameter that was parsed from the command line.\n *\n * @remarks\n * The return value will be `undefined` if the command-line has not been parsed yet,\n * or if the parameter was omitted and has no default value.\n */\n public get value(): TChoice | undefined {\n return this._value;\n }\n\n /** {@inheritDoc CommandLineParameter.appendToArgList} @override */\n public appendToArgList(argList: string[]): void {\n if (this.value !== undefined) {\n argList.push(this.longName);\n argList.push(this.value);\n }\n }\n}\n"]}
|
|
@@ -39,7 +39,9 @@ export interface IBaseCommandLineDefinition {
|
|
|
39
39
|
*
|
|
40
40
|
* @remarks
|
|
41
41
|
* The environment variable name must consist only of upper-case letters, numbers,
|
|
42
|
-
* and underscores. It may not start with a number.
|
|
42
|
+
* and underscores. It may not start with a number. To disable this validation, set
|
|
43
|
+
* `{@link IBaseCommandLineDefinition.allowNonStandardEnvironmentVariableNames}`
|
|
44
|
+
* to `true`.
|
|
43
45
|
*
|
|
44
46
|
* This feature cannot be used when {@link IBaseCommandLineDefinition.required} is true,
|
|
45
47
|
* because in that case the environmentVariable would never be used.
|
|
@@ -67,6 +69,19 @@ export interface IBaseCommandLineDefinition {
|
|
|
67
69
|
* ordinary String Parameter: Any value is accepted, including an empty string.
|
|
68
70
|
*/
|
|
69
71
|
environmentVariable?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Allows for the use of environment variable names that do not conform to the standard
|
|
74
|
+
* described by the Shell and Utilities volume of IEEE Std 1003.1-2001. This disables
|
|
75
|
+
* the validation that is performed on the provided
|
|
76
|
+
* {@link IBaseCommandLineDefinition.environmentVariable} value by default.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* if this is set to `true`, environment variable discovery will vary based on the
|
|
80
|
+
* platform in use. For example, Windows environment variable names are case-insensitive,
|
|
81
|
+
* while on Linux, environment variable names are case-sensitive. It is recommended that
|
|
82
|
+
* this option be used only when necessary based on environmental constraints.
|
|
83
|
+
*/
|
|
84
|
+
allowNonStandardEnvironmentVariableNames?: boolean;
|
|
70
85
|
/**
|
|
71
86
|
* Specifies additional names for this parameter that are accepted but not displayed
|
|
72
87
|
* in the command line help.
|
|
@@ -105,28 +120,29 @@ export interface IBaseCommandLineDefinitionWithArgument extends IBaseCommandLine
|
|
|
105
120
|
completions?: () => Promise<string[]>;
|
|
106
121
|
}
|
|
107
122
|
/**
|
|
108
|
-
* For use with {@link CommandLineParameterProvider.defineChoiceParameter}
|
|
109
|
-
* this interface
|
|
123
|
+
* For use with {@link CommandLineParameterProvider.(defineChoiceParameter:1)} and
|
|
124
|
+
* {@link CommandLineParameterProvider.(defineChoiceParameter:2)}, this interface
|
|
125
|
+
* defines a command line parameter which is constrained to a list of possible
|
|
110
126
|
* options.
|
|
111
127
|
*
|
|
112
128
|
* @public
|
|
113
129
|
*/
|
|
114
|
-
export interface ICommandLineChoiceDefinition extends IBaseCommandLineDefinition {
|
|
130
|
+
export interface ICommandLineChoiceDefinition<TChoice extends string = string> extends IBaseCommandLineDefinition {
|
|
115
131
|
/**
|
|
116
132
|
* A list of strings (which contain no spaces), of possible options which can be selected
|
|
117
133
|
*/
|
|
118
|
-
alternatives:
|
|
134
|
+
alternatives: TChoice[];
|
|
119
135
|
/**
|
|
120
136
|
* {@inheritDoc ICommandLineStringDefinition.defaultValue}
|
|
121
137
|
*/
|
|
122
|
-
defaultValue?:
|
|
138
|
+
defaultValue?: TChoice;
|
|
123
139
|
/**
|
|
124
140
|
* An optional callback that provides a list of custom choices for tab completion.
|
|
125
141
|
* @remarks
|
|
126
142
|
* This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`
|
|
127
143
|
* is enabled.
|
|
128
144
|
*/
|
|
129
|
-
completions?: () => Promise<
|
|
145
|
+
completions?: () => Promise<TChoice[]>;
|
|
130
146
|
}
|
|
131
147
|
/**
|
|
132
148
|
* For use with {@link CommandLineParameterProvider.defineChoiceListParameter},
|
|
@@ -135,18 +151,18 @@ export interface ICommandLineChoiceDefinition extends IBaseCommandLineDefinition
|
|
|
135
151
|
*
|
|
136
152
|
* @public
|
|
137
153
|
*/
|
|
138
|
-
export interface ICommandLineChoiceListDefinition extends IBaseCommandLineDefinition {
|
|
154
|
+
export interface ICommandLineChoiceListDefinition<TChoice extends string = string> extends IBaseCommandLineDefinition {
|
|
139
155
|
/**
|
|
140
156
|
* A list of strings (which contain no spaces), of possible options which can be selected
|
|
141
157
|
*/
|
|
142
|
-
alternatives:
|
|
158
|
+
alternatives: TChoice[];
|
|
143
159
|
/**
|
|
144
160
|
* An optional callback that provides a list of custom choices for tab completion.
|
|
145
161
|
* @remarks
|
|
146
162
|
* This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`
|
|
147
163
|
* is enabled.
|
|
148
164
|
*/
|
|
149
|
-
completions?: () => Promise<
|
|
165
|
+
completions?: () => Promise<TChoice[]>;
|
|
150
166
|
}
|
|
151
167
|
/**
|
|
152
168
|
* For use with {@link CommandLineParameterProvider.defineFlagParameter},
|
|
@@ -157,8 +173,9 @@ export interface ICommandLineChoiceListDefinition extends IBaseCommandLineDefini
|
|
|
157
173
|
export interface ICommandLineFlagDefinition extends IBaseCommandLineDefinition {
|
|
158
174
|
}
|
|
159
175
|
/**
|
|
160
|
-
* For use with {@link CommandLineParameterProvider.defineIntegerParameter},
|
|
161
|
-
* this interface
|
|
176
|
+
* For use with {@link CommandLineParameterProvider.(defineIntegerParameter:1)},
|
|
177
|
+
* {@link CommandLineParameterProvider.(defineIntegerParameter:2)}, this interface
|
|
178
|
+
* defines a command line parameter whose argument is an integer value.
|
|
162
179
|
*
|
|
163
180
|
* @public
|
|
164
181
|
*/
|
|
@@ -178,8 +195,9 @@ export interface ICommandLineIntegerDefinition extends IBaseCommandLineDefinitio
|
|
|
178
195
|
export interface ICommandLineIntegerListDefinition extends IBaseCommandLineDefinitionWithArgument {
|
|
179
196
|
}
|
|
180
197
|
/**
|
|
181
|
-
* For use with {@link CommandLineParameterProvider.defineStringParameter}
|
|
182
|
-
* this interface
|
|
198
|
+
* For use with {@link CommandLineParameterProvider.(defineStringParameter:1)} and
|
|
199
|
+
* {@link CommandLineParameterProvider.(defineStringParameter:2)}, this interface
|
|
200
|
+
* defines a command line parameter whose argument is a string value.
|
|
183
201
|
*
|
|
184
202
|
* @public
|
|
185
203
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineDefinition.d.ts","sourceRoot":"","sources":["../../src/parameters/CommandLineDefinition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,uBAAuB,CAAC;IAEzD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB
|
|
1
|
+
{"version":3,"file":"CommandLineDefinition.d.ts","sourceRoot":"","sources":["../../src/parameters/CommandLineDefinition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,uBAAuB,CAAC;IAEzD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;;;;;;OAWG;IACH,wCAAwC,CAAC,EAAE,OAAO,CAAC;IAEnD;;;;;;;;OAQG;IACH,oBAAoB,CAAC,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GG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineDefinition.js","sourceRoot":"","sources":["../../src/parameters/CommandLineDefinition.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { SCOPING_PARAMETER_GROUP } from '../Constants';\n\n/**\n * For use with CommandLineParser, this interface represents a generic command-line parameter\n *\n * @public\n */\nexport interface IBaseCommandLineDefinition {\n /**\n * The long name of the flag including double dashes, e.g. \"--do-something\"\n */\n parameterLongName: string;\n\n /**\n * An optional short name for the flag including the dash, e.g. \"-d\"\n */\n parameterShortName?: string;\n\n /**\n * An optional parameter group name, shown when invoking the tool with \"--help\"\n */\n parameterGroup?: string | typeof SCOPING_PARAMETER_GROUP;\n\n /**\n * An optional parameter scope name, used to add a scope-prefixed parameter synonym,\n * e.g. \"--scope:do-something\". Scopes provide additional flexibility for parameters\n * in conflict resolution since when a scope is specified, parameters that have\n * conflicting long names will be defined using only the scope-prefixed name.\n */\n parameterScope?: string;\n\n /**\n * Documentation for the parameter that will be shown when invoking the tool with \"--help\"\n */\n description: string;\n\n /**\n * If true, then an error occurs if the parameter was not included on the command-line.\n */\n required?: boolean;\n\n /**\n * The name of an environment variable that the parameter value will be read from,\n * if it was omitted from the command-line. An error will be reported if the\n * environment value cannot be parsed.\n *\n * @remarks\n * The environment variable name must consist only of upper-case letters, numbers,\n * and underscores. It may not start with a number.\n *\n * This feature cannot be used when {@link IBaseCommandLineDefinition.required} is true,\n * because in that case the environmentVariable would never be used.\n *\n * Syntax notes for environment variable values:\n *\n * - Choice Parameter: The value must match one of the defined choices,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - Flag Parameter: The value must be `1` for true, or `0` for false,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - Integer Parameter: The value must be an integer number,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - String Parameter: Any value is accepted, including an empty string.\n *\n * - String List Parameter: If the string starts with `[` (ignoring whitespace)\n * then it will be parsed as a JSON array, whose elements must be strings,\n * numbers, or boolean values.\n * If the string does not start with `[`, then it behaves like an\n * ordinary String Parameter: Any value is accepted, including an empty string.\n */\n environmentVariable?: string;\n\n /**\n * Specifies additional names for this parameter that are accepted but not displayed\n * in the command line help.\n *\n * @remarks\n * This option can be used in cases where a command-line parameter may have been renamed,\n * but the developer doesn't want to break backwards compatibility with systems that may\n * still be using the old name. Only the `parameterLongName` syntax is currently allowed.\n */\n undocumentedSynonyms?: string[];\n}\n\n/**\n * The common base interface for parameter types that accept an argument.\n *\n * @remarks\n * An argument is an accompanying command-line token, such as \"123\" in the\n * example \"--max-count 123\".\n * @public\n */\nexport interface IBaseCommandLineDefinitionWithArgument extends IBaseCommandLineDefinition {\n /**\n * The name of the argument, which will be shown in the command-line help.\n *\n * @remarks\n * For example, if the parameter name is '--count\" and the argument name is \"NUMBER\",\n * then the command-line help would display \"--count NUMBER\". The argument name must\n * be comprised of upper-case letters, numbers, and underscores. It should be kept short.\n */\n argumentName: string;\n\n /**\n * An optional callback that provides a list of custom choices for tab completion.\n * @remarks\n * This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`\n * is enabled.\n */\n completions?: () => Promise<string[]>;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineChoiceParameter},\n * this interface defines a command line parameter which is constrained to a list of possible\n * options.\n *\n * @public\n */\nexport interface ICommandLineChoiceDefinition extends IBaseCommandLineDefinition {\n /**\n * A list of strings (which contain no spaces), of possible options which can be selected\n */\n alternatives: string[];\n\n /**\n * {@inheritDoc ICommandLineStringDefinition.defaultValue}\n */\n defaultValue?: string;\n\n /**\n * An optional callback that provides a list of custom choices for tab completion.\n * @remarks\n * This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`\n * is enabled.\n */\n completions?: () => Promise<string[]>;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineChoiceListParameter},\n * this interface defines a command line parameter which is constrained to a list of possible\n * options. The parameter can be specified multiple times to build a list.\n *\n * @public\n */\nexport interface ICommandLineChoiceListDefinition extends IBaseCommandLineDefinition {\n /**\n * A list of strings (which contain no spaces), of possible options which can be selected\n */\n alternatives: string[];\n\n /**\n * An optional callback that provides a list of custom choices for tab completion.\n * @remarks\n * This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`\n * is enabled.\n */\n completions?: () => Promise<string[]>;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineFlagParameter},\n * this interface defines a command line parameter that is a boolean flag.\n *\n * @public\n */\nexport interface ICommandLineFlagDefinition extends IBaseCommandLineDefinition {}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineIntegerParameter},\n * this interface defines a command line parameter whose argument is an integer value.\n *\n * @public\n */\nexport interface ICommandLineIntegerDefinition extends IBaseCommandLineDefinitionWithArgument {\n /**\n * {@inheritDoc ICommandLineStringDefinition.defaultValue}\n */\n defaultValue?: number;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineIntegerListParameter},\n * this interface defines a command line parameter whose argument is an integer value. The\n * parameter can be specified multiple times to build a list.\n *\n * @public\n */\nexport interface ICommandLineIntegerListDefinition extends IBaseCommandLineDefinitionWithArgument {}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineStringParameter},\n * this interface defines a command line parameter whose argument is a string value.\n *\n * @public\n */\nexport interface ICommandLineStringDefinition extends IBaseCommandLineDefinitionWithArgument {\n /**\n * The default value which will be used if the parameter is omitted from the command line.\n *\n * @remarks\n * If a default value is specified, then {@link IBaseCommandLineDefinition.required}\n * must not be true. Instead, a custom error message should be used to report cases\n * where a default value was not available.\n */\n defaultValue?: string;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineStringListParameter},\n * this interface defines a command line parameter whose argument is a single text string.\n * The parameter can be specified multiple times to build a list.\n *\n * @public\n */\nexport interface ICommandLineStringListDefinition extends IBaseCommandLineDefinitionWithArgument {}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineCommandLineRemainder},\n * this interface defines a rule that captures any remaining command line arguments after the recognized portion.\n *\n * @public\n */\nexport interface ICommandLineRemainderDefinition {\n /**\n * Documentation for how the remaining arguments will be used. This will be shown when invoking\n * the tool with \"--help\".\n */\n description: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CommandLineDefinition.js","sourceRoot":"","sources":["../../src/parameters/CommandLineDefinition.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { SCOPING_PARAMETER_GROUP } from '../Constants';\n\n/**\n * For use with CommandLineParser, this interface represents a generic command-line parameter\n *\n * @public\n */\nexport interface IBaseCommandLineDefinition {\n /**\n * The long name of the flag including double dashes, e.g. \"--do-something\"\n */\n parameterLongName: string;\n\n /**\n * An optional short name for the flag including the dash, e.g. \"-d\"\n */\n parameterShortName?: string;\n\n /**\n * An optional parameter group name, shown when invoking the tool with \"--help\"\n */\n parameterGroup?: string | typeof SCOPING_PARAMETER_GROUP;\n\n /**\n * An optional parameter scope name, used to add a scope-prefixed parameter synonym,\n * e.g. \"--scope:do-something\". Scopes provide additional flexibility for parameters\n * in conflict resolution since when a scope is specified, parameters that have\n * conflicting long names will be defined using only the scope-prefixed name.\n */\n parameterScope?: string;\n\n /**\n * Documentation for the parameter that will be shown when invoking the tool with \"--help\"\n */\n description: string;\n\n /**\n * If true, then an error occurs if the parameter was not included on the command-line.\n */\n required?: boolean;\n\n /**\n * The name of an environment variable that the parameter value will be read from,\n * if it was omitted from the command-line. An error will be reported if the\n * environment value cannot be parsed.\n *\n * @remarks\n * The environment variable name must consist only of upper-case letters, numbers,\n * and underscores. It may not start with a number. To disable this validation, set\n * `{@link IBaseCommandLineDefinition.allowNonStandardEnvironmentVariableNames}`\n * to `true`.\n *\n * This feature cannot be used when {@link IBaseCommandLineDefinition.required} is true,\n * because in that case the environmentVariable would never be used.\n *\n * Syntax notes for environment variable values:\n *\n * - Choice Parameter: The value must match one of the defined choices,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - Flag Parameter: The value must be `1` for true, or `0` for false,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - Integer Parameter: The value must be an integer number,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - String Parameter: Any value is accepted, including an empty string.\n *\n * - String List Parameter: If the string starts with `[` (ignoring whitespace)\n * then it will be parsed as a JSON array, whose elements must be strings,\n * numbers, or boolean values.\n * If the string does not start with `[`, then it behaves like an\n * ordinary String Parameter: Any value is accepted, including an empty string.\n */\n environmentVariable?: string;\n\n /**\n * Allows for the use of environment variable names that do not conform to the standard\n * described by the Shell and Utilities volume of IEEE Std 1003.1-2001. This disables\n * the validation that is performed on the provided\n * {@link IBaseCommandLineDefinition.environmentVariable} value by default.\n *\n * @remarks\n * if this is set to `true`, environment variable discovery will vary based on the\n * platform in use. For example, Windows environment variable names are case-insensitive,\n * while on Linux, environment variable names are case-sensitive. It is recommended that\n * this option be used only when necessary based on environmental constraints.\n */\n allowNonStandardEnvironmentVariableNames?: boolean;\n\n /**\n * Specifies additional names for this parameter that are accepted but not displayed\n * in the command line help.\n *\n * @remarks\n * This option can be used in cases where a command-line parameter may have been renamed,\n * but the developer doesn't want to break backwards compatibility with systems that may\n * still be using the old name. Only the `parameterLongName` syntax is currently allowed.\n */\n undocumentedSynonyms?: string[];\n}\n\n/**\n * The common base interface for parameter types that accept an argument.\n *\n * @remarks\n * An argument is an accompanying command-line token, such as \"123\" in the\n * example \"--max-count 123\".\n * @public\n */\nexport interface IBaseCommandLineDefinitionWithArgument extends IBaseCommandLineDefinition {\n /**\n * The name of the argument, which will be shown in the command-line help.\n *\n * @remarks\n * For example, if the parameter name is '--count\" and the argument name is \"NUMBER\",\n * then the command-line help would display \"--count NUMBER\". The argument name must\n * be comprised of upper-case letters, numbers, and underscores. It should be kept short.\n */\n argumentName: string;\n\n /**\n * An optional callback that provides a list of custom choices for tab completion.\n * @remarks\n * This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`\n * is enabled.\n */\n completions?: () => Promise<string[]>;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.(defineChoiceParameter:1)} and\n * {@link CommandLineParameterProvider.(defineChoiceParameter:2)}, this interface\n * defines a command line parameter which is constrained to a list of possible\n * options.\n *\n * @public\n */\nexport interface ICommandLineChoiceDefinition<TChoice extends string = string>\n extends IBaseCommandLineDefinition {\n /**\n * A list of strings (which contain no spaces), of possible options which can be selected\n */\n alternatives: TChoice[];\n\n /**\n * {@inheritDoc ICommandLineStringDefinition.defaultValue}\n */\n defaultValue?: TChoice;\n\n /**\n * An optional callback that provides a list of custom choices for tab completion.\n * @remarks\n * This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`\n * is enabled.\n */\n completions?: () => Promise<TChoice[]>;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineChoiceListParameter},\n * this interface defines a command line parameter which is constrained to a list of possible\n * options. The parameter can be specified multiple times to build a list.\n *\n * @public\n */\nexport interface ICommandLineChoiceListDefinition<TChoice extends string = string>\n extends IBaseCommandLineDefinition {\n /**\n * A list of strings (which contain no spaces), of possible options which can be selected\n */\n alternatives: TChoice[];\n\n /**\n * An optional callback that provides a list of custom choices for tab completion.\n * @remarks\n * This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`\n * is enabled.\n */\n completions?: () => Promise<TChoice[]>;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineFlagParameter},\n * this interface defines a command line parameter that is a boolean flag.\n *\n * @public\n */\nexport interface ICommandLineFlagDefinition extends IBaseCommandLineDefinition {}\n\n/**\n * For use with {@link CommandLineParameterProvider.(defineIntegerParameter:1)},\n * {@link CommandLineParameterProvider.(defineIntegerParameter:2)}, this interface\n * defines a command line parameter whose argument is an integer value.\n *\n * @public\n */\nexport interface ICommandLineIntegerDefinition extends IBaseCommandLineDefinitionWithArgument {\n /**\n * {@inheritDoc ICommandLineStringDefinition.defaultValue}\n */\n defaultValue?: number;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineIntegerListParameter},\n * this interface defines a command line parameter whose argument is an integer value. The\n * parameter can be specified multiple times to build a list.\n *\n * @public\n */\nexport interface ICommandLineIntegerListDefinition extends IBaseCommandLineDefinitionWithArgument {}\n\n/**\n * For use with {@link CommandLineParameterProvider.(defineStringParameter:1)} and\n * {@link CommandLineParameterProvider.(defineStringParameter:2)}, this interface\n * defines a command line parameter whose argument is a string value.\n *\n * @public\n */\nexport interface ICommandLineStringDefinition extends IBaseCommandLineDefinitionWithArgument {\n /**\n * The default value which will be used if the parameter is omitted from the command line.\n *\n * @remarks\n * If a default value is specified, then {@link IBaseCommandLineDefinition.required}\n * must not be true. Instead, a custom error message should be used to report cases\n * where a default value was not available.\n */\n defaultValue?: string;\n}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineStringListParameter},\n * this interface defines a command line parameter whose argument is a single text string.\n * The parameter can be specified multiple times to build a list.\n *\n * @public\n */\nexport interface ICommandLineStringListDefinition extends IBaseCommandLineDefinitionWithArgument {}\n\n/**\n * For use with {@link CommandLineParameterProvider.defineCommandLineRemainder},\n * this interface defines a rule that captures any remaining command line arguments after the recognized portion.\n *\n * @public\n */\nexport interface ICommandLineRemainderDefinition {\n /**\n * Documentation for how the remaining arguments will be used. This will be shown when invoking\n * the tool with \"--help\".\n */\n description: string;\n}\n"]}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ICommandLineIntegerDefinition } from './CommandLineDefinition';
|
|
2
2
|
import { CommandLineParameterWithArgument, CommandLineParameterKind } from './BaseClasses';
|
|
3
3
|
/**
|
|
4
|
-
* The data type returned by {@link CommandLineParameterProvider.defineIntegerParameter}.
|
|
4
|
+
* The data type returned by {@link CommandLineParameterProvider.(defineIntegerParameter:2)}.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IRequiredCommandLineIntegerParameter extends CommandLineIntegerParameter {
|
|
8
|
+
value: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The data type returned by {@link CommandLineParameterProvider.(defineIntegerParameter:1)}.
|
|
5
12
|
* @public
|
|
6
13
|
*/
|
|
7
14
|
export declare class CommandLineIntegerParameter extends CommandLineParameterWithArgument {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineIntegerParameter.d.ts","sourceRoot":"","sources":["../../src/parameters/CommandLineIntegerParameter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE3F;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,gCAAgC;IAC/E,8DAA8D;IAC9D,SAAgB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjD,OAAO,CAAC,MAAM,CAAiC;IAE/C,gBAAgB;gBACG,UAAU,EAAE,6BAA6B;IAM5D,8CAA8C;IAC9C,IAAW,IAAI,IAAI,wBAAwB,CAE1C;IAED;;;OAGG;IAEI,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAkCjC;;;OAGG;IACI,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI;IAQjE;;;;;;OAMG;IACH,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,mEAAmE;IAC5D,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;CAMhD"}
|
|
1
|
+
{"version":3,"file":"CommandLineIntegerParameter.d.ts","sourceRoot":"","sources":["../../src/parameters/CommandLineIntegerParameter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE3F;;;GAGG;AACH,MAAM,WAAW,oCAAqC,SAAQ,2BAA2B;IACvF,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,gCAAgC;IAC/E,8DAA8D;IAC9D,SAAgB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjD,OAAO,CAAC,MAAM,CAAiC;IAE/C,gBAAgB;gBACG,UAAU,EAAE,6BAA6B;IAM5D,8CAA8C;IAC9C,IAAW,IAAI,IAAI,wBAAwB,CAE1C;IAED;;;OAGG;IAEI,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAkCjC;;;OAGG;IACI,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI;IAQjE;;;;;;OAMG;IACH,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,mEAAmE;IAC5D,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;CAMhD"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.CommandLineIntegerParameter = void 0;
|
|
6
6
|
const BaseClasses_1 = require("./BaseClasses");
|
|
7
7
|
/**
|
|
8
|
-
* The data type returned by {@link CommandLineParameterProvider.defineIntegerParameter}.
|
|
8
|
+
* The data type returned by {@link CommandLineParameterProvider.(defineIntegerParameter:1)}.
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
11
|
class CommandLineIntegerParameter extends BaseClasses_1.CommandLineParameterWithArgument {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineIntegerParameter.js","sourceRoot":"","sources":["../../src/parameters/CommandLineIntegerParameter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,+CAA2F;
|
|
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CAAC;oBACxD,MAAM,IAAI,KAAK,CACb,kBAAkB,gBAAgB,gCAAgC;wBAChE,IAAI,IAAI,CAAC,mBAAmB,iCAAiC,CAChE,CAAC;gBACJ,CAAC;gBACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;gBACrB,OAAO;YACT,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;YAChC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,sBAAsB,CAAC,kBAA4B;QACxD,UAAU;QACV,KAAK,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;QACjD,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,kBAAkB,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,mEAAmE;IAC5D,eAAe,CAAC,OAAiB;QACtC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF;AAvFD,kEAuFC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ICommandLineIntegerDefinition } from './CommandLineDefinition';\nimport { CommandLineParameterWithArgument, CommandLineParameterKind } from './BaseClasses';\n\n/**\n * The data type returned by {@link CommandLineParameterProvider.(defineIntegerParameter:2)}.\n * @public\n */\nexport interface IRequiredCommandLineIntegerParameter extends CommandLineIntegerParameter {\n value: number;\n}\n\n/**\n * The data type returned by {@link CommandLineParameterProvider.(defineIntegerParameter:1)}.\n * @public\n */\nexport class CommandLineIntegerParameter extends CommandLineParameterWithArgument {\n /** {@inheritDoc ICommandLineStringDefinition.defaultValue} */\n public readonly defaultValue: number | undefined;\n\n private _value: number | undefined = undefined;\n\n /** @internal */\n public constructor(definition: ICommandLineIntegerDefinition) {\n super(definition);\n this.defaultValue = definition.defaultValue;\n this.validateDefaultValue(!!this.defaultValue);\n }\n\n /** {@inheritDoc CommandLineParameter.kind} */\n public get kind(): CommandLineParameterKind {\n return CommandLineParameterKind.Integer;\n }\n\n /**\n * {@inheritDoc CommandLineParameter._setValue}\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public _setValue(data: any): void {\n // abstract\n if (data !== null && data !== undefined) {\n if (typeof data !== 'number') {\n this.reportInvalidData(data);\n }\n this._value = data;\n return;\n }\n\n if (this.environmentVariable !== undefined) {\n // Try reading the environment variable\n const environmentValue: string | undefined = process.env[this.environmentVariable];\n if (environmentValue !== undefined && environmentValue !== '') {\n const parsed: number = parseInt(environmentValue, 10);\n if (isNaN(parsed) || environmentValue.indexOf('.') >= 0) {\n throw new Error(\n `Invalid value \"${environmentValue}\" for the environment variable` +\n ` ${this.environmentVariable}. It must be an integer value.`\n );\n }\n this._value = parsed;\n return;\n }\n }\n\n if (this.defaultValue !== undefined) {\n this._value = this.defaultValue;\n return;\n }\n\n this._value = undefined;\n }\n\n /**\n * {@inheritDoc CommandLineParameter._getSupplementaryNotes}\n * @internal\n */\n public _getSupplementaryNotes(supplementaryNotes: string[]): void {\n // virtual\n super._getSupplementaryNotes(supplementaryNotes);\n if (this.defaultValue !== undefined) {\n supplementaryNotes.push(`The default value is ${this.defaultValue}.`);\n }\n }\n\n /**\n * Returns the argument value for an integer parameter that was parsed from the command line.\n *\n * @remarks\n * The return value will be undefined if the command-line has not been parsed yet,\n * or if the parameter was omitted and has no default value.\n */\n public get value(): number | undefined {\n return this._value;\n }\n\n /** {@inheritDoc CommandLineParameter.appendToArgList} @override */\n public appendToArgList(argList: string[]): void {\n if (this.value !== undefined) {\n argList.push(this.longName);\n argList.push(this.value.toString());\n }\n }\n}\n"]}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ICommandLineStringDefinition } from './CommandLineDefinition';
|
|
2
2
|
import { CommandLineParameterWithArgument, CommandLineParameterKind } from './BaseClasses';
|
|
3
3
|
/**
|
|
4
|
-
* The data type returned by {@link CommandLineParameterProvider.defineStringParameter}.
|
|
4
|
+
* The data type returned by {@link CommandLineParameterProvider.(defineStringParameter:2)}.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IRequiredCommandLineStringParameter extends CommandLineStringParameter {
|
|
8
|
+
value: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The data type returned by {@link CommandLineParameterProvider.(defineStringParameter:1)}.
|
|
5
12
|
* @public
|
|
6
13
|
*/
|
|
7
14
|
export declare class CommandLineStringParameter extends CommandLineParameterWithArgument {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineStringParameter.d.ts","sourceRoot":"","sources":["../../src/parameters/CommandLineStringParameter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE3F;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,gCAAgC;IAC9E,8DAA8D;IAC9D,SAAgB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjD,OAAO,CAAC,MAAM,CAAiC;IAE/C,gBAAgB;gBACG,UAAU,EAAE,4BAA4B;IAO3D,8CAA8C;IAC9C,IAAW,IAAI,IAAI,wBAAwB,CAE1C;IAED;;;OAGG;IAEI,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IA6BjC;;;OAGG;IACI,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI;IAUjE;;;;;;OAMG;IACH,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,mEAAmE;IAC5D,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;CAMhD"}
|
|
1
|
+
{"version":3,"file":"CommandLineStringParameter.d.ts","sourceRoot":"","sources":["../../src/parameters/CommandLineStringParameter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAE3F;;;GAGG;AACH,MAAM,WAAW,mCAAoC,SAAQ,0BAA0B;IACrF,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,gCAAgC;IAC9E,8DAA8D;IAC9D,SAAgB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjD,OAAO,CAAC,MAAM,CAAiC;IAE/C,gBAAgB;gBACG,UAAU,EAAE,4BAA4B;IAO3D,8CAA8C;IAC9C,IAAW,IAAI,IAAI,wBAAwB,CAE1C;IAED;;;OAGG;IAEI,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IA6BjC;;;OAGG;IACI,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI;IAUjE;;;;;;OAMG;IACH,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,mEAAmE;IAC5D,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;CAMhD"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.CommandLineStringParameter = void 0;
|
|
6
6
|
const BaseClasses_1 = require("./BaseClasses");
|
|
7
7
|
/**
|
|
8
|
-
* The data type returned by {@link CommandLineParameterProvider.defineStringParameter}.
|
|
8
|
+
* The data type returned by {@link CommandLineParameterProvider.(defineStringParameter:1)}.
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
11
|
class CommandLineStringParameter extends BaseClasses_1.CommandLineParameterWithArgument {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineStringParameter.js","sourceRoot":"","sources":["../../src/parameters/CommandLineStringParameter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,+CAA2F;
|
|
1
|
+
{"version":3,"file":"CommandLineStringParameter.js","sourceRoot":"","sources":["../../src/parameters/CommandLineStringParameter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,+CAA2F;AAU3F;;;GAGG;AACH,MAAa,0BAA2B,SAAQ,8CAAgC;IAM9E,gBAAgB;IAChB,YAAmB,UAAwC;QACzD,KAAK,CAAC,UAAU,CAAC,CAAC;QAJZ,WAAM,GAAuB,SAAS,CAAC;QAM7C,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjD,CAAC;IAED,8CAA8C;IAC9C,IAAW,IAAI;QACb,OAAO,sCAAwB,CAAC,MAAM,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,8DAA8D;IACvD,SAAS,CAAC,IAAS;QACxB,WAAW;QACX,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACxC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACnB,OAAO;QACT,CAAC;QAED,IAAI,IAAI,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAC3C,uCAAuC;YACvC,MAAM,gBAAgB,GAAuB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACnC,mEAAmE;gBACnE,0FAA0F;gBAC1F,IAAI,CAAC,MAAM,GAAG,gBAAgB,CAAC;gBAC/B,OAAO;YACT,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;YAChC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,sBAAsB,CAAC,kBAA4B;QACxD,UAAU;QACV,KAAK,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;QACjD,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;gBACnC,kBAAkB,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YACxF,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,mEAAmE;IAC5D,eAAe,CAAC,OAAiB;QACtC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF;AArFD,gEAqFC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { ICommandLineStringDefinition } from './CommandLineDefinition';\nimport { CommandLineParameterWithArgument, CommandLineParameterKind } from './BaseClasses';\n\n/**\n * The data type returned by {@link CommandLineParameterProvider.(defineStringParameter:2)}.\n * @public\n */\nexport interface IRequiredCommandLineStringParameter extends CommandLineStringParameter {\n value: string;\n}\n\n/**\n * The data type returned by {@link CommandLineParameterProvider.(defineStringParameter:1)}.\n * @public\n */\nexport class CommandLineStringParameter extends CommandLineParameterWithArgument {\n /** {@inheritDoc ICommandLineStringDefinition.defaultValue} */\n public readonly defaultValue: string | undefined;\n\n private _value: string | undefined = undefined;\n\n /** @internal */\n public constructor(definition: ICommandLineStringDefinition) {\n super(definition);\n\n this.defaultValue = definition.defaultValue;\n this.validateDefaultValue(!!this.defaultValue);\n }\n\n /** {@inheritDoc CommandLineParameter.kind} */\n public get kind(): CommandLineParameterKind {\n return CommandLineParameterKind.String;\n }\n\n /**\n * {@inheritDoc CommandLineParameter._setValue}\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public _setValue(data: any): void {\n // abstract\n if (data !== null && data !== undefined) {\n if (typeof data !== 'string') {\n this.reportInvalidData(data);\n }\n this._value = data;\n return;\n }\n\n if (this.environmentVariable !== undefined) {\n // Try reading the environment variable\n const environmentValue: string | undefined = process.env[this.environmentVariable];\n if (environmentValue !== undefined) {\n // NOTE: If the environment variable is defined as an empty string,\n // here we will accept the empty string as our value. (For number/flag we don't do that.)\n this._value = environmentValue;\n return;\n }\n }\n\n if (this.defaultValue !== undefined) {\n this._value = this.defaultValue;\n return;\n }\n\n this._value = undefined;\n }\n\n /**\n * {@inheritDoc CommandLineParameter._getSupplementaryNotes}\n * @internal\n */\n public _getSupplementaryNotes(supplementaryNotes: string[]): void {\n // virtual\n super._getSupplementaryNotes(supplementaryNotes);\n if (this.defaultValue !== undefined) {\n if (this.defaultValue.length < 160) {\n supplementaryNotes.push(`The default value is ${JSON.stringify(this.defaultValue)}.`);\n }\n }\n }\n\n /**\n * Returns the argument value for a string parameter that was parsed from the command line.\n *\n * @remarks\n * The return value will be undefined if the command-line has not been parsed yet,\n * or if the parameter was omitted and has no default value.\n */\n public get value(): string | undefined {\n return this._value;\n }\n\n /** {@inheritDoc CommandLineParameter.appendToArgList} @override */\n public appendToArgList(argList: string[]): void {\n if (this.value !== undefined) {\n argList.push(this.longName);\n argList.push(this.value);\n }\n }\n}\n"]}
|
|
@@ -2,16 +2,16 @@ import * as argparse from 'argparse';
|
|
|
2
2
|
import type { ICommandLineChoiceDefinition, ICommandLineChoiceListDefinition, ICommandLineIntegerDefinition, ICommandLineIntegerListDefinition, ICommandLineFlagDefinition, ICommandLineStringDefinition, ICommandLineStringListDefinition, ICommandLineRemainderDefinition } from '../parameters/CommandLineDefinition';
|
|
3
3
|
import type { ICommandLineParserOptions } from './CommandLineParser';
|
|
4
4
|
import { type CommandLineParameter } from '../parameters/BaseClasses';
|
|
5
|
-
import { CommandLineChoiceParameter } from '../parameters/CommandLineChoiceParameter';
|
|
5
|
+
import { CommandLineChoiceParameter, type IRequiredCommandLineChoiceParameter } from '../parameters/CommandLineChoiceParameter';
|
|
6
6
|
import { CommandLineChoiceListParameter } from '../parameters/CommandLineChoiceListParameter';
|
|
7
|
-
import { CommandLineIntegerParameter } from '../parameters/CommandLineIntegerParameter';
|
|
7
|
+
import { CommandLineIntegerParameter, type IRequiredCommandLineIntegerParameter } from '../parameters/CommandLineIntegerParameter';
|
|
8
8
|
import { CommandLineIntegerListParameter } from '../parameters/CommandLineIntegerListParameter';
|
|
9
9
|
import { CommandLineFlagParameter } from '../parameters/CommandLineFlagParameter';
|
|
10
|
-
import { CommandLineStringParameter } from '../parameters/CommandLineStringParameter';
|
|
10
|
+
import { CommandLineStringParameter, type IRequiredCommandLineStringParameter } from '../parameters/CommandLineStringParameter';
|
|
11
11
|
import { CommandLineStringListParameter } from '../parameters/CommandLineStringListParameter';
|
|
12
12
|
import { CommandLineRemainder } from '../parameters/CommandLineRemainder';
|
|
13
13
|
/**
|
|
14
|
-
* The result containing the parsed
|
|
14
|
+
* The result containing the parsed parameter long name and scope. Returned when calling
|
|
15
15
|
* {@link CommandLineParameterProvider.parseScopedLongName}.
|
|
16
16
|
*
|
|
17
17
|
* @public
|
|
@@ -93,7 +93,19 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
93
93
|
* example-tool --log-level warn
|
|
94
94
|
* ```
|
|
95
95
|
*/
|
|
96
|
-
defineChoiceParameter(definition: ICommandLineChoiceDefinition
|
|
96
|
+
defineChoiceParameter<TChoice extends string = string>(definition: ICommandLineChoiceDefinition<TChoice> & {
|
|
97
|
+
required: false | undefined;
|
|
98
|
+
}): CommandLineChoiceParameter<TChoice>;
|
|
99
|
+
/**
|
|
100
|
+
* {@inheritdoc CommandLineParameterProvider.(defineChoiceParameter:1)}
|
|
101
|
+
*/
|
|
102
|
+
defineChoiceParameter<TChoice extends string = string>(definition: ICommandLineChoiceDefinition<TChoice> & {
|
|
103
|
+
required: true;
|
|
104
|
+
}): IRequiredCommandLineChoiceParameter<TChoice>;
|
|
105
|
+
/**
|
|
106
|
+
* {@inheritdoc CommandLineParameterProvider.(defineChoiceParameter:1)}
|
|
107
|
+
*/
|
|
108
|
+
defineChoiceParameter<TChoice extends string = string>(definition: ICommandLineChoiceDefinition<TChoice>): CommandLineChoiceParameter<TChoice>;
|
|
97
109
|
/**
|
|
98
110
|
* Returns the CommandLineChoiceParameter with the specified long name.
|
|
99
111
|
* @remarks
|
|
@@ -111,7 +123,7 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
111
123
|
* example-tool --allow-color red --allow-color green
|
|
112
124
|
* ```
|
|
113
125
|
*/
|
|
114
|
-
defineChoiceListParameter(definition: ICommandLineChoiceListDefinition): CommandLineChoiceListParameter
|
|
126
|
+
defineChoiceListParameter<TChoice extends string = string>(definition: ICommandLineChoiceListDefinition<TChoice>): CommandLineChoiceListParameter<TChoice>;
|
|
115
127
|
/**
|
|
116
128
|
* Returns the CommandLineChoiceListParameter with the specified long name.
|
|
117
129
|
* @remarks
|
|
@@ -144,6 +156,18 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
144
156
|
* example-tool --max-attempts 5
|
|
145
157
|
* ```
|
|
146
158
|
*/
|
|
159
|
+
defineIntegerParameter(definition: ICommandLineIntegerDefinition & {
|
|
160
|
+
required: false | undefined;
|
|
161
|
+
}): CommandLineIntegerParameter;
|
|
162
|
+
/**
|
|
163
|
+
* {@inheritdoc CommandLineParameterProvider.(defineIntegerParameter:1)}
|
|
164
|
+
*/
|
|
165
|
+
defineIntegerParameter(definition: ICommandLineIntegerDefinition & {
|
|
166
|
+
required: true;
|
|
167
|
+
}): IRequiredCommandLineIntegerParameter;
|
|
168
|
+
/**
|
|
169
|
+
* {@inheritdoc CommandLineParameterProvider.(defineIntegerParameter:1)}
|
|
170
|
+
*/
|
|
147
171
|
defineIntegerParameter(definition: ICommandLineIntegerDefinition): CommandLineIntegerParameter;
|
|
148
172
|
/**
|
|
149
173
|
* Returns the CommandLineIntegerParameter with the specified long name.
|
|
@@ -177,6 +201,18 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
177
201
|
* example-tool --message "Hello, world!"
|
|
178
202
|
* ```
|
|
179
203
|
*/
|
|
204
|
+
defineStringParameter(definition: ICommandLineStringDefinition & {
|
|
205
|
+
required: false | undefined;
|
|
206
|
+
}): CommandLineStringParameter;
|
|
207
|
+
/**
|
|
208
|
+
* {@inheritdoc CommandLineParameterProvider.(defineStringParameter:1)}
|
|
209
|
+
*/
|
|
210
|
+
defineStringParameter(definition: ICommandLineStringDefinition & {
|
|
211
|
+
required: true;
|
|
212
|
+
}): IRequiredCommandLineStringParameter;
|
|
213
|
+
/**
|
|
214
|
+
* {@inheritdoc CommandLineParameterProvider.(defineStringParameter:1)}
|
|
215
|
+
*/
|
|
180
216
|
defineStringParameter(definition: ICommandLineStringDefinition): CommandLineStringParameter;
|
|
181
217
|
/**
|
|
182
218
|
* Returns the CommandLineStringParameter with the specified long name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineParameterProvider.d.ts","sourceRoot":"","sources":["../../src/providers/CommandLineParameterProvider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EACV,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EACjC,0BAA0B,EAC1B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"CommandLineParameterProvider.d.ts","sourceRoot":"","sources":["../../src/providers/CommandLineParameterProvider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EACV,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EACjC,0BAA0B,EAC1B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAChC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,0BAA0B,EAC1B,KAAK,mCAAmC,EACzC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EACL,2BAA2B,EAC3B,KAAK,oCAAoC,EAC1C,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EACL,0BAA0B,EAC1B,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IjC;;OAEG;IACI,cAAc,IAAI,MAAM;IAQ/B;;OAEG;IACI,eAAe,IAAI,MAAM;IAQhC;;;;OAIG;IACI,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAmCtD;;OAEG;IACI,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,0BAA0B;IAW9E,gBAAgB;IACT,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,GAAG,IAAI;IAyE/E;;;OAGG;IACH,SAAS,CAAC,kBAAkB,CAAC,IAAI,IAAI;IAErC;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,kBAAkB,IAAI,QAAQ,CAAC,cAAc;IAEhE,gBAAgB;IAChB,SAAS,CAAC,kBAAkB,CAAC,aAAa,EAAE,yBAAyB,EAAE,IAAI,EAAE,sBAAsB,GAAG,IAAI;IA0G1G,gBAAgB;IAChB,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI;IAiCjE,gBAAgB;IAChB,SAAS,CAAC,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAkBzD,gBAAgB;IAChB,SAAS,CAAC,kBAAkB,CAC1B,SAAS,EAAE,oBAAoB,EAC/B,iBAAiB,EAAE,OAAO,EAC1B,eAAe,EAAE,OAAO,GACvB,IAAI;IAwGP,SAAS,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAW5E,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,aAAa;IAwCrB,OAAO,CAAC,qBAAqB;CAiB9B"}
|
|
@@ -79,16 +79,6 @@ class CommandLineParameterProvider {
|
|
|
79
79
|
get remainder() {
|
|
80
80
|
return this._remainder;
|
|
81
81
|
}
|
|
82
|
-
/**
|
|
83
|
-
* Defines a command-line parameter whose value must be a string from a fixed set of
|
|
84
|
-
* allowable choices (similar to an enum).
|
|
85
|
-
*
|
|
86
|
-
* @remarks
|
|
87
|
-
* Example of a choice parameter:
|
|
88
|
-
* ```
|
|
89
|
-
* example-tool --log-level warn
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
82
|
defineChoiceParameter(definition) {
|
|
93
83
|
const parameter = new CommandLineChoiceParameter_1.CommandLineChoiceParameter(definition);
|
|
94
84
|
this._defineParameter(parameter);
|
|
@@ -149,15 +139,6 @@ class CommandLineParameterProvider {
|
|
|
149
139
|
getFlagParameter(parameterLongName, parameterScope) {
|
|
150
140
|
return this._getParameter(parameterLongName, BaseClasses_1.CommandLineParameterKind.Flag, parameterScope);
|
|
151
141
|
}
|
|
152
|
-
/**
|
|
153
|
-
* Defines a command-line parameter whose argument is an integer.
|
|
154
|
-
*
|
|
155
|
-
* @remarks
|
|
156
|
-
* Example usage of an integer parameter:
|
|
157
|
-
* ```
|
|
158
|
-
* example-tool --max-attempts 5
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
142
|
defineIntegerParameter(definition) {
|
|
162
143
|
const parameter = new CommandLineIntegerParameter_1.CommandLineIntegerParameter(definition);
|
|
163
144
|
this._defineParameter(parameter);
|
|
@@ -194,15 +175,6 @@ class CommandLineParameterProvider {
|
|
|
194
175
|
getIntegerListParameter(parameterLongName, parameterScope) {
|
|
195
176
|
return this._getParameter(parameterLongName, BaseClasses_1.CommandLineParameterKind.IntegerList, parameterScope);
|
|
196
177
|
}
|
|
197
|
-
/**
|
|
198
|
-
* Defines a command-line parameter whose argument is a single text string.
|
|
199
|
-
*
|
|
200
|
-
* @remarks
|
|
201
|
-
* Example usage of a string parameter:
|
|
202
|
-
* ```
|
|
203
|
-
* example-tool --message "Hello, world!"
|
|
204
|
-
* ```
|
|
205
|
-
*/
|
|
206
178
|
defineStringParameter(definition) {
|
|
207
179
|
const parameter = new CommandLineStringParameter_1.CommandLineStringParameter(definition);
|
|
208
180
|
this._defineParameter(parameter);
|