@rushstack/ts-command-line 4.23.6 → 5.0.0
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/CHANGELOG.json +30 -0
- package/CHANGELOG.md +14 -1
- package/README.md +3 -3
- package/dist/ts-command-line.d.ts +34 -55
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -3
- package/lib/index.js.map +1 -1
- package/lib/parameters/BaseClasses.d.ts +5 -2
- package/lib/parameters/BaseClasses.d.ts.map +1 -1
- package/lib/parameters/BaseClasses.js +1 -1
- package/lib/parameters/BaseClasses.js.map +1 -1
- package/lib/parameters/CommandLineChoiceListParameter.d.ts +3 -3
- package/lib/parameters/CommandLineChoiceListParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineChoiceListParameter.js +3 -3
- package/lib/parameters/CommandLineChoiceListParameter.js.map +1 -1
- package/lib/parameters/CommandLineChoiceParameter.d.ts +4 -4
- package/lib/parameters/CommandLineChoiceParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineChoiceParameter.js +4 -4
- package/lib/parameters/CommandLineChoiceParameter.js.map +1 -1
- package/lib/parameters/CommandLineDefinition.d.ts +1 -3
- package/lib/parameters/CommandLineDefinition.d.ts.map +1 -1
- package/lib/parameters/CommandLineDefinition.js.map +1 -1
- package/lib/parameters/CommandLineFlagParameter.d.ts +3 -3
- package/lib/parameters/CommandLineFlagParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineFlagParameter.js +3 -3
- package/lib/parameters/CommandLineFlagParameter.js.map +1 -1
- package/lib/parameters/CommandLineIntegerListParameter.d.ts +3 -3
- package/lib/parameters/CommandLineIntegerListParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineIntegerListParameter.js +3 -3
- package/lib/parameters/CommandLineIntegerListParameter.js.map +1 -1
- package/lib/parameters/CommandLineIntegerParameter.d.ts +4 -4
- package/lib/parameters/CommandLineIntegerParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineIntegerParameter.js +4 -4
- package/lib/parameters/CommandLineIntegerParameter.js.map +1 -1
- package/lib/parameters/CommandLineRemainder.d.ts +2 -2
- package/lib/parameters/CommandLineRemainder.d.ts.map +1 -1
- package/lib/parameters/CommandLineRemainder.js +2 -2
- package/lib/parameters/CommandLineRemainder.js.map +1 -1
- package/lib/parameters/CommandLineStringListParameter.d.ts +3 -3
- package/lib/parameters/CommandLineStringListParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineStringListParameter.js +3 -3
- package/lib/parameters/CommandLineStringListParameter.js.map +1 -1
- package/lib/parameters/CommandLineStringParameter.d.ts +4 -4
- package/lib/parameters/CommandLineStringParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineStringParameter.js +4 -4
- package/lib/parameters/CommandLineStringParameter.js.map +1 -1
- package/lib/providers/AliasCommandLineAction.d.ts +1 -1
- package/lib/providers/AliasCommandLineAction.d.ts.map +1 -1
- package/lib/providers/AliasCommandLineAction.js +1 -1
- package/lib/providers/AliasCommandLineAction.js.map +1 -1
- package/lib/providers/CommandLineAction.d.ts +1 -4
- package/lib/providers/CommandLineAction.d.ts.map +1 -1
- package/lib/providers/CommandLineAction.js +2 -5
- package/lib/providers/CommandLineAction.js.map +1 -1
- package/lib/providers/CommandLineParameterProvider.d.ts +2 -6
- package/lib/providers/CommandLineParameterProvider.d.ts.map +1 -1
- package/lib/providers/CommandLineParameterProvider.js.map +1 -1
- package/lib/providers/CommandLineParser.d.ts +1 -9
- package/lib/providers/CommandLineParser.d.ts.map +1 -1
- package/lib/providers/CommandLineParser.js +3 -19
- package/lib/providers/CommandLineParser.js.map +1 -1
- package/lib/providers/CommandLineParserExitError.d.ts.map +1 -1
- package/lib/providers/CommandLineParserExitError.js +0 -2
- package/lib/providers/CommandLineParserExitError.js.map +1 -1
- package/lib/providers/DynamicCommandLineAction.d.ts +1 -1
- package/lib/providers/DynamicCommandLineAction.d.ts.map +1 -1
- package/lib/providers/DynamicCommandLineAction.js +1 -1
- package/lib/providers/DynamicCommandLineAction.js.map +1 -1
- package/lib/providers/ScopedCommandLineAction.d.ts +4 -11
- package/lib/providers/ScopedCommandLineAction.d.ts.map +1 -1
- package/lib/providers/ScopedCommandLineAction.js +2 -10
- package/lib/providers/ScopedCommandLineAction.js.map +1 -1
- package/lib/providers/TabCompletionAction.d.ts +1 -1
- package/lib/providers/TabCompletionAction.d.ts.map +1 -1
- package/lib/providers/TabCompletionAction.js +2 -2
- package/lib/providers/TabCompletionAction.js.map +1 -1
- package/package.json +6 -8
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/ts-command-line",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "5.0.0",
|
|
6
|
+
"tag": "@rushstack/ts-command-line_v5.0.0",
|
|
7
|
+
"date": "Mon, 21 Apr 2025 22:24:25 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"major": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Remove the deprecated `onDefineParameters`, `execute`, `executeWithoutErrorHandling`, and `onDefineUnscopedParameters` functions."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"comment": "Rename `onExecute` to `onExecuteAsync`, `CommandLineParameter` to `CommandLineParameterBase`, and `completions` to `getCompletionsAsync`."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"version": "4.23.7",
|
|
21
|
+
"tag": "@rushstack/ts-command-line_v4.23.7",
|
|
22
|
+
"date": "Tue, 25 Mar 2025 15:11:15 GMT",
|
|
23
|
+
"comments": {
|
|
24
|
+
"dependency": [
|
|
25
|
+
{
|
|
26
|
+
"comment": "Updating dependency \"@rushstack/terminal\" to `0.15.2`"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"comment": "Updating dependency \"@rushstack/node-core-library\" to `5.13.0`"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
4
34
|
{
|
|
5
35
|
"version": "4.23.6",
|
|
6
36
|
"tag": "@rushstack/ts-command-line_v4.23.6",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Change Log - @rushstack/ts-command-line
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 21 Apr 2025 22:24:25 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.0.0
|
|
6
|
+
Mon, 21 Apr 2025 22:24:25 GMT
|
|
7
|
+
|
|
8
|
+
### Breaking changes
|
|
9
|
+
|
|
10
|
+
- Remove the deprecated `onDefineParameters`, `execute`, `executeWithoutErrorHandling`, and `onDefineUnscopedParameters` functions.
|
|
11
|
+
- Rename `onExecute` to `onExecuteAsync`, `CommandLineParameter` to `CommandLineParameterBase`, and `completions` to `getCompletionsAsync`.
|
|
12
|
+
|
|
13
|
+
## 4.23.7
|
|
14
|
+
Tue, 25 Mar 2025 15:11:15 GMT
|
|
15
|
+
|
|
16
|
+
_Version update only_
|
|
4
17
|
|
|
5
18
|
## 4.23.6
|
|
6
19
|
Tue, 11 Mar 2025 02:12:33 GMT
|
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ export class PushAction extends CommandLineAction {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
protected async
|
|
93
|
+
protected override async onExecuteAsync(): Promise<void> { // abstract
|
|
94
94
|
await BusinessLogic.doTheWork(this._force.value, this._protocol.value || "(none)");
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -117,9 +117,9 @@ export class WidgetCommandLine extends CommandLineParser {
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
protected async
|
|
120
|
+
protected override async onExecuteAsync(): Promise<void> {
|
|
121
121
|
BusinessLogic.configureLogger(this._verbose.value);
|
|
122
|
-
await super.
|
|
122
|
+
await super.onExecuteAsync();
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
```
|
|
@@ -32,7 +32,7 @@ export declare class AliasCommandLineAction extends CommandLineAction {
|
|
|
32
32
|
/**
|
|
33
33
|
* Executes the target action.
|
|
34
34
|
*/
|
|
35
|
-
protected
|
|
35
|
+
protected onExecuteAsync(): Promise<void>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -62,24 +62,21 @@ export declare abstract class CommandLineAction extends CommandLineParameterProv
|
|
|
62
62
|
/* Excluded from this release type: _getArgumentParser */
|
|
63
63
|
/**
|
|
64
64
|
* Your subclass should implement this hook to perform the operation.
|
|
65
|
-
*
|
|
66
|
-
* @remarks
|
|
67
|
-
* In a future release, this function will be renamed to onExecuteAsync
|
|
68
65
|
*/
|
|
69
|
-
protected abstract
|
|
66
|
+
protected abstract onExecuteAsync(): Promise<void>;
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
/**
|
|
73
70
|
* The data type returned by {@link CommandLineParameterProvider.defineChoiceListParameter}.
|
|
74
71
|
* @public
|
|
75
72
|
*/
|
|
76
|
-
export declare class CommandLineChoiceListParameter<TChoice extends string = string> extends
|
|
73
|
+
export declare class CommandLineChoiceListParameter<TChoice extends string = string> extends CommandLineParameterBase {
|
|
77
74
|
/** {@inheritDoc ICommandLineChoiceListDefinition.alternatives} */
|
|
78
75
|
readonly alternatives: ReadonlySet<TChoice>;
|
|
79
76
|
private _values;
|
|
80
77
|
/** {@inheritDoc ICommandLineChoiceListDefinition.completions} */
|
|
81
78
|
readonly completions: (() => Promise<ReadonlyArray<TChoice> | ReadonlySet<TChoice>>) | undefined;
|
|
82
|
-
/** {@inheritDoc
|
|
79
|
+
/** {@inheritDoc CommandLineParameterBase.kind} */
|
|
83
80
|
readonly kind: CommandLineParameterKind.ChoiceList;
|
|
84
81
|
/* Excluded from this release type: __constructor */
|
|
85
82
|
/* Excluded from this release type: _setValue */
|
|
@@ -91,7 +88,7 @@ export declare class CommandLineChoiceListParameter<TChoice extends string = str
|
|
|
91
88
|
* or if the parameter was omitted and has no default value.
|
|
92
89
|
*/
|
|
93
90
|
get values(): ReadonlyArray<TChoice>;
|
|
94
|
-
/** {@inheritDoc
|
|
91
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
95
92
|
appendToArgList(argList: string[]): void;
|
|
96
93
|
}
|
|
97
94
|
|
|
@@ -99,7 +96,7 @@ export declare class CommandLineChoiceListParameter<TChoice extends string = str
|
|
|
99
96
|
* The data type returned by {@link CommandLineParameterProvider.(defineChoiceParameter:1)}.
|
|
100
97
|
* @public
|
|
101
98
|
*/
|
|
102
|
-
export declare class CommandLineChoiceParameter<TChoice extends string = string> extends
|
|
99
|
+
export declare class CommandLineChoiceParameter<TChoice extends string = string> extends CommandLineParameterBase {
|
|
103
100
|
/** {@inheritDoc ICommandLineChoiceDefinition.alternatives} */
|
|
104
101
|
readonly alternatives: ReadonlySet<TChoice>;
|
|
105
102
|
/** {@inheritDoc ICommandLineStringDefinition.defaultValue} */
|
|
@@ -107,7 +104,7 @@ export declare class CommandLineChoiceParameter<TChoice extends string = string>
|
|
|
107
104
|
private _value;
|
|
108
105
|
/** {@inheritDoc ICommandLineChoiceDefinition.completions} */
|
|
109
106
|
readonly completions: (() => Promise<ReadonlyArray<TChoice> | ReadonlySet<TChoice>>) | undefined;
|
|
110
|
-
/** {@inheritDoc
|
|
107
|
+
/** {@inheritDoc CommandLineParameterBase.kind} */
|
|
111
108
|
readonly kind: CommandLineParameterKind.Choice;
|
|
112
109
|
/* Excluded from this release type: __constructor */
|
|
113
110
|
/* Excluded from this release type: _setValue */
|
|
@@ -120,7 +117,7 @@ export declare class CommandLineChoiceParameter<TChoice extends string = string>
|
|
|
120
117
|
* or if the parameter was omitted and has no default value.
|
|
121
118
|
*/
|
|
122
119
|
get value(): TChoice | undefined;
|
|
123
|
-
/** {@inheritDoc
|
|
120
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
124
121
|
appendToArgList(argList: string[]): void;
|
|
125
122
|
}
|
|
126
123
|
|
|
@@ -140,9 +137,9 @@ export declare enum CommandLineConstants {
|
|
|
140
137
|
* The data type returned by {@link CommandLineParameterProvider.defineFlagParameter}.
|
|
141
138
|
* @public
|
|
142
139
|
*/
|
|
143
|
-
export declare class CommandLineFlagParameter extends
|
|
140
|
+
export declare class CommandLineFlagParameter extends CommandLineParameterBase {
|
|
144
141
|
private _value;
|
|
145
|
-
/** {@inheritDoc
|
|
142
|
+
/** {@inheritDoc CommandLineParameterBase.kind} */
|
|
146
143
|
readonly kind: CommandLineParameterKind.Flag;
|
|
147
144
|
/* Excluded from this release type: __constructor */
|
|
148
145
|
/* Excluded from this release type: _setValue */
|
|
@@ -154,7 +151,7 @@ export declare class CommandLineFlagParameter extends CommandLineParameter {
|
|
|
154
151
|
* or if the flag was not used.
|
|
155
152
|
*/
|
|
156
153
|
get value(): boolean;
|
|
157
|
-
/** {@inheritDoc
|
|
154
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
158
155
|
appendToArgList(argList: string[]): void;
|
|
159
156
|
}
|
|
160
157
|
|
|
@@ -178,7 +175,7 @@ export declare class CommandLineHelper {
|
|
|
178
175
|
*/
|
|
179
176
|
export declare class CommandLineIntegerListParameter extends CommandLineParameterWithArgument {
|
|
180
177
|
private _values;
|
|
181
|
-
/** {@inheritDoc
|
|
178
|
+
/** {@inheritDoc CommandLineParameterBase.kind} */
|
|
182
179
|
readonly kind: CommandLineParameterKind.IntegerList;
|
|
183
180
|
/* Excluded from this release type: __constructor */
|
|
184
181
|
/* Excluded from this release type: _setValue */
|
|
@@ -190,7 +187,7 @@ export declare class CommandLineIntegerListParameter extends CommandLineParamete
|
|
|
190
187
|
* or if the parameter was omitted and has no default value.
|
|
191
188
|
*/
|
|
192
189
|
get values(): ReadonlyArray<number>;
|
|
193
|
-
/** {@inheritDoc
|
|
190
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
194
191
|
appendToArgList(argList: string[]): void;
|
|
195
192
|
}
|
|
196
193
|
|
|
@@ -202,7 +199,7 @@ export declare class CommandLineIntegerParameter extends CommandLineParameterWit
|
|
|
202
199
|
/** {@inheritDoc ICommandLineStringDefinition.defaultValue} */
|
|
203
200
|
readonly defaultValue: number | undefined;
|
|
204
201
|
private _value;
|
|
205
|
-
/** {@inheritDoc
|
|
202
|
+
/** {@inheritDoc CommandLineParameterBase.kind} */
|
|
206
203
|
readonly kind: CommandLineParameterKind.Integer;
|
|
207
204
|
/* Excluded from this release type: __constructor */
|
|
208
205
|
/* Excluded from this release type: _setValue */
|
|
@@ -215,15 +212,20 @@ export declare class CommandLineIntegerParameter extends CommandLineParameterWit
|
|
|
215
212
|
* or if the parameter was omitted and has no default value.
|
|
216
213
|
*/
|
|
217
214
|
get value(): number | undefined;
|
|
218
|
-
/** {@inheritDoc
|
|
215
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
219
216
|
appendToArgList(argList: string[]): void;
|
|
220
217
|
}
|
|
221
218
|
|
|
219
|
+
/**
|
|
220
|
+
* @public
|
|
221
|
+
*/
|
|
222
|
+
export declare type CommandLineParameter = CommandLineChoiceListParameter | CommandLineChoiceParameter | CommandLineFlagParameter | CommandLineIntegerListParameter | CommandLineIntegerParameter | CommandLineStringListParameter | CommandLineStringParameter;
|
|
223
|
+
|
|
222
224
|
/**
|
|
223
225
|
* The base class for the various command-line parameter types.
|
|
224
226
|
* @public
|
|
225
227
|
*/
|
|
226
|
-
export declare abstract class
|
|
228
|
+
export declare abstract class CommandLineParameterBase {
|
|
227
229
|
private _shortNameValue;
|
|
228
230
|
/* Excluded from this release type: _parserKey */
|
|
229
231
|
/* Excluded from this release type: _preParse */
|
|
@@ -280,8 +282,6 @@ export declare abstract class CommandLineParameter {
|
|
|
280
282
|
protected validateDefaultValue(hasDefaultValue: boolean): void;
|
|
281
283
|
}
|
|
282
284
|
|
|
283
|
-
declare type CommandLineParameter_2 = CommandLineChoiceListParameter | CommandLineChoiceParameter | CommandLineFlagParameter | CommandLineIntegerListParameter | CommandLineIntegerParameter | CommandLineStringListParameter | CommandLineStringParameter;
|
|
284
|
-
|
|
285
285
|
/**
|
|
286
286
|
* Identifies the kind of a CommandLineParameter.
|
|
287
287
|
* @public
|
|
@@ -544,10 +544,6 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
544
544
|
*/
|
|
545
545
|
parseScopedLongName(scopedLongName: string): IScopedLongNameParseResult;
|
|
546
546
|
/* Excluded from this release type: _registerDefinedParameters */
|
|
547
|
-
/**
|
|
548
|
-
* @deprecated - Define parameters in the constructor
|
|
549
|
-
*/
|
|
550
|
-
protected onDefineParameters?(): void;
|
|
551
547
|
/* Excluded from this release type: _getArgumentParser */
|
|
552
548
|
/* Excluded from this release type: _preParse */
|
|
553
549
|
/* Excluded from this release type: _postParse */
|
|
@@ -569,12 +565,12 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
569
565
|
* example "--max-count 123".
|
|
570
566
|
* @public
|
|
571
567
|
*/
|
|
572
|
-
export declare abstract class CommandLineParameterWithArgument extends
|
|
568
|
+
export declare abstract class CommandLineParameterWithArgument extends CommandLineParameterBase {
|
|
573
569
|
private static _invalidArgumentNameRegExp;
|
|
574
570
|
/** {@inheritDoc IBaseCommandLineDefinitionWithArgument.argumentName} */
|
|
575
571
|
readonly argumentName: string;
|
|
576
|
-
/** {@inheritDoc IBaseCommandLineDefinitionWithArgument.
|
|
577
|
-
readonly
|
|
572
|
+
/** {@inheritDoc IBaseCommandLineDefinitionWithArgument.getCompletionsAsync} */
|
|
573
|
+
readonly getCompletionsAsync: (() => Promise<ReadonlyArray<string> | ReadonlySet<string>>) | undefined;
|
|
578
574
|
/* Excluded from this release type: __constructor */
|
|
579
575
|
}
|
|
580
576
|
|
|
@@ -639,19 +635,11 @@ export declare abstract class CommandLineParser extends CommandLineParameterProv
|
|
|
639
635
|
* the process.argv will be used
|
|
640
636
|
*/
|
|
641
637
|
executeAsync(args?: string[]): Promise<boolean>;
|
|
642
|
-
/**
|
|
643
|
-
* @deprecated Use {@link CommandLineParser.executeAsync} instead.
|
|
644
|
-
*/
|
|
645
|
-
execute(args?: string[]): Promise<boolean>;
|
|
646
638
|
/**
|
|
647
639
|
* This is similar to {@link CommandLineParser.executeAsync}, except that execution errors
|
|
648
640
|
* simply cause the promise to reject. It is the caller's responsibility to trap
|
|
649
641
|
*/
|
|
650
642
|
executeWithoutErrorHandlingAsync(args?: string[]): Promise<void>;
|
|
651
|
-
/**
|
|
652
|
-
* @deprecated Use {@link CommandLineParser.executeWithoutErrorHandlingAsync} instead.
|
|
653
|
-
*/
|
|
654
|
-
executeWithoutErrorHandling(args?: string[]): Promise<void>;
|
|
655
643
|
/* Excluded from this release type: _registerDefinedParameters */
|
|
656
644
|
private _validateDefinitions;
|
|
657
645
|
/* Excluded from this release type: _getArgumentParser */
|
|
@@ -659,7 +647,7 @@ export declare abstract class CommandLineParser extends CommandLineParameterProv
|
|
|
659
647
|
* This hook allows the subclass to perform additional operations before or after
|
|
660
648
|
* the chosen action is executed.
|
|
661
649
|
*/
|
|
662
|
-
protected
|
|
650
|
+
protected onExecuteAsync(): Promise<void>;
|
|
663
651
|
}
|
|
664
652
|
|
|
665
653
|
/**
|
|
@@ -680,7 +668,7 @@ export declare class CommandLineRemainder {
|
|
|
680
668
|
*/
|
|
681
669
|
get values(): ReadonlyArray<string>;
|
|
682
670
|
/* Excluded from this release type: _setValue */
|
|
683
|
-
/** {@inheritDoc
|
|
671
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
684
672
|
appendToArgList(argList: string[]): void;
|
|
685
673
|
}
|
|
686
674
|
|
|
@@ -690,7 +678,7 @@ export declare class CommandLineRemainder {
|
|
|
690
678
|
*/
|
|
691
679
|
export declare class CommandLineStringListParameter extends CommandLineParameterWithArgument {
|
|
692
680
|
private _values;
|
|
693
|
-
/** {@inheritDoc
|
|
681
|
+
/** {@inheritDoc CommandLineParameterBase.kind} */
|
|
694
682
|
readonly kind: CommandLineParameterKind.StringList;
|
|
695
683
|
/* Excluded from this release type: __constructor */
|
|
696
684
|
/* Excluded from this release type: _setValue */
|
|
@@ -702,7 +690,7 @@ export declare class CommandLineStringListParameter extends CommandLineParameter
|
|
|
702
690
|
* or if the parameter was omitted and has no default value.
|
|
703
691
|
*/
|
|
704
692
|
get values(): ReadonlyArray<string>;
|
|
705
|
-
/** {@inheritDoc
|
|
693
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
706
694
|
appendToArgList(argList: string[]): void;
|
|
707
695
|
}
|
|
708
696
|
|
|
@@ -714,7 +702,7 @@ export declare class CommandLineStringParameter extends CommandLineParameterWith
|
|
|
714
702
|
/** {@inheritDoc ICommandLineStringDefinition.defaultValue} */
|
|
715
703
|
readonly defaultValue: string | undefined;
|
|
716
704
|
private _value;
|
|
717
|
-
/** {@inheritDoc
|
|
705
|
+
/** {@inheritDoc CommandLineParameterBase.kind} */
|
|
718
706
|
readonly kind: CommandLineParameterKind.String;
|
|
719
707
|
/* Excluded from this release type: __constructor */
|
|
720
708
|
/* Excluded from this release type: _setValue */
|
|
@@ -727,7 +715,7 @@ export declare class CommandLineStringParameter extends CommandLineParameterWith
|
|
|
727
715
|
* or if the parameter was omitted and has no default value.
|
|
728
716
|
*/
|
|
729
717
|
get value(): string | undefined;
|
|
730
|
-
/** {@inheritDoc
|
|
718
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
731
719
|
appendToArgList(argList: string[]): void;
|
|
732
720
|
}
|
|
733
721
|
|
|
@@ -735,7 +723,7 @@ export declare class CommandLineStringParameter extends CommandLineParameterWith
|
|
|
735
723
|
* @public
|
|
736
724
|
*/
|
|
737
725
|
export declare class DynamicCommandLineAction extends CommandLineAction {
|
|
738
|
-
protected
|
|
726
|
+
protected onExecuteAsync(): Promise<void>;
|
|
739
727
|
}
|
|
740
728
|
|
|
741
729
|
/**
|
|
@@ -883,10 +871,8 @@ export declare interface IBaseCommandLineDefinitionWithArgument extends IBaseCom
|
|
|
883
871
|
* @remarks
|
|
884
872
|
* This option is only used when `ICommandLineParserOptions.enableTabCompletionAction`
|
|
885
873
|
* is enabled.
|
|
886
|
-
*
|
|
887
|
-
* In a future release, this will be renamed to `getCompletionsAsync`
|
|
888
874
|
*/
|
|
889
|
-
|
|
875
|
+
getCompletionsAsync?: () => Promise<ReadonlyArray<string> | ReadonlySet<string>>;
|
|
890
876
|
}
|
|
891
877
|
|
|
892
878
|
/**
|
|
@@ -1139,9 +1125,6 @@ export declare abstract class ScopedCommandLineAction extends CommandLineAction
|
|
|
1139
1125
|
constructor(options: ICommandLineActionOptions);
|
|
1140
1126
|
/**
|
|
1141
1127
|
* {@inheritDoc CommandLineParameterProvider.parameters}
|
|
1142
|
-
*
|
|
1143
|
-
* @internalremarks
|
|
1144
|
-
* TODO: Replace this type with `CommandLineParameter` in the next major bump.
|
|
1145
1128
|
*/
|
|
1146
1129
|
get parameters(): ReadonlyArray<CommandLineParameter>;
|
|
1147
1130
|
/* Excluded from this release type: _processParsedData */
|
|
@@ -1149,10 +1132,6 @@ export declare abstract class ScopedCommandLineAction extends CommandLineAction
|
|
|
1149
1132
|
/* Excluded from this release type: _registerDefinedParameters */
|
|
1150
1133
|
/* Excluded from this release type: _getScopedCommandLineParser */
|
|
1151
1134
|
/* Excluded from this release type: _defineParameter */
|
|
1152
|
-
/**
|
|
1153
|
-
* @deprecated - Define parameters in the constructor
|
|
1154
|
-
*/
|
|
1155
|
-
protected onDefineUnscopedParameters?(): void;
|
|
1156
1135
|
/**
|
|
1157
1136
|
* The child class should implement this hook to define its scoped command-line
|
|
1158
1137
|
* parameters, e.g. by calling scopedParameterProvider.defineFlagParameter(). These
|
|
@@ -1164,9 +1143,9 @@ export declare abstract class ScopedCommandLineAction extends CommandLineAction
|
|
|
1164
1143
|
*/
|
|
1165
1144
|
protected abstract onDefineScopedParameters(scopedParameterProvider: CommandLineParameterProvider): void;
|
|
1166
1145
|
/**
|
|
1167
|
-
* {@inheritDoc CommandLineAction.
|
|
1146
|
+
* {@inheritDoc CommandLineAction.onExecuteAsync}
|
|
1168
1147
|
*/
|
|
1169
|
-
protected abstract
|
|
1148
|
+
protected abstract onExecuteAsync(): Promise<void>;
|
|
1170
1149
|
}
|
|
1171
1150
|
|
|
1172
1151
|
declare const SCOPING_PARAMETER_GROUP: unique symbol;
|
package/dist/tsdoc-metadata.json
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { DynamicCommandLineAction } from './providers/DynamicCommandLineAction';
|
|
|
8
8
|
export { ScopedCommandLineAction } from './providers/ScopedCommandLineAction';
|
|
9
9
|
export { AliasCommandLineAction, type IAliasCommandLineActionOptions } from './providers/AliasCommandLineAction';
|
|
10
10
|
export type { IBaseCommandLineDefinition, IBaseCommandLineDefinitionWithArgument, ICommandLineFlagDefinition, ICommandLineStringDefinition, ICommandLineStringListDefinition, ICommandLineIntegerDefinition, ICommandLineIntegerListDefinition, ICommandLineChoiceDefinition, ICommandLineChoiceListDefinition, ICommandLineRemainderDefinition } from './parameters/CommandLineDefinition';
|
|
11
|
-
export { CommandLineParameterKind, CommandLineParameterBase
|
|
11
|
+
export { type CommandLineParameter, CommandLineParameterKind, CommandLineParameterBase, CommandLineParameterWithArgument } from './parameters/BaseClasses';
|
|
12
12
|
export { CommandLineFlagParameter } from './parameters/CommandLineFlagParameter';
|
|
13
13
|
export { CommandLineStringParameter, type IRequiredCommandLineStringParameter } from './parameters/CommandLineStringParameter';
|
|
14
14
|
export { CommandLineStringListParameter } from './parameters/CommandLineStringListParameter';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,KAAK,yB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AC7F,OAAO,EACL,2BAA2B,EAC3B,KAAK,oCAAoC,EAC1C,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,EACL,0BAA0B,EAC1B,KAAK,mCAAmC,EACzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EACL,4BAA4B,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,IAAI,uBAAuB,EACtD,KAAK,+BAA+B,IAAI,gCAAgC,EACzE,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
3
3
|
// See LICENSE in the project root for license information.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.CommandLineHelper = exports.CommandLineConstants = exports.DynamicCommandLineParser = exports.CommandLineParser = exports.CommandLineParameterProvider = exports.CommandLineRemainder = exports.CommandLineChoiceListParameter = exports.CommandLineChoiceParameter = exports.CommandLineIntegerListParameter = exports.CommandLineIntegerParameter = exports.CommandLineStringListParameter = exports.CommandLineStringParameter = exports.CommandLineFlagParameter = exports.CommandLineParameterWithArgument = exports.
|
|
5
|
+
exports.CommandLineHelper = exports.CommandLineConstants = exports.DynamicCommandLineParser = exports.CommandLineParser = exports.CommandLineParameterProvider = exports.CommandLineRemainder = exports.CommandLineChoiceListParameter = exports.CommandLineChoiceParameter = exports.CommandLineIntegerListParameter = exports.CommandLineIntegerParameter = exports.CommandLineStringListParameter = exports.CommandLineStringParameter = exports.CommandLineFlagParameter = exports.CommandLineParameterWithArgument = exports.CommandLineParameterBase = exports.CommandLineParameterKind = exports.AliasCommandLineAction = exports.ScopedCommandLineAction = exports.DynamicCommandLineAction = exports.CommandLineAction = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* An object-oriented command-line parser for TypeScript projects.
|
|
8
8
|
*
|
|
@@ -18,8 +18,7 @@ var AliasCommandLineAction_1 = require("./providers/AliasCommandLineAction");
|
|
|
18
18
|
Object.defineProperty(exports, "AliasCommandLineAction", { enumerable: true, get: function () { return AliasCommandLineAction_1.AliasCommandLineAction; } });
|
|
19
19
|
var BaseClasses_1 = require("./parameters/BaseClasses");
|
|
20
20
|
Object.defineProperty(exports, "CommandLineParameterKind", { enumerable: true, get: function () { return BaseClasses_1.CommandLineParameterKind; } });
|
|
21
|
-
|
|
22
|
-
Object.defineProperty(exports, "CommandLineParameter", { enumerable: true, get: function () { return BaseClasses_1.CommandLineParameterBase; } });
|
|
21
|
+
Object.defineProperty(exports, "CommandLineParameterBase", { enumerable: true, get: function () { return BaseClasses_1.CommandLineParameterBase; } });
|
|
23
22
|
Object.defineProperty(exports, "CommandLineParameterWithArgument", { enumerable: true, get: function () { return BaseClasses_1.CommandLineParameterWithArgument; } });
|
|
24
23
|
var CommandLineFlagParameter_1 = require("./parameters/CommandLineFlagParameter");
|
|
25
24
|
Object.defineProperty(exports, "CommandLineFlagParameter", { enumerable: true, get: function () { return CommandLineFlagParameter_1.CommandLineFlagParameter; } });
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;GAIG;AAEH,mEAAkG;AAAzF,sHAAA,iBAAiB,OAAA;AAC1B,iFAAgF;AAAvE,oIAAA,wBAAwB,OAAA;AACjC,+EAA8E;AAArE,kIAAA,uBAAuB,OAAA;AAChC,6EAG4C;AAF1C,gIAAA,sBAAsB,OAAA;AAiBxB,wDAKkC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D;;;;GAIG;AAEH,mEAAkG;AAAzF,sHAAA,iBAAiB,OAAA;AAC1B,iFAAgF;AAAvE,oIAAA,wBAAwB,OAAA;AACjC,+EAA8E;AAArE,kIAAA,uBAAuB,OAAA;AAChC,6EAG4C;AAF1C,gIAAA,sBAAsB,OAAA;AAiBxB,wDAKkC;AAHhC,uHAAA,wBAAwB,OAAA;AACxB,uHAAA,wBAAwB,OAAA;AACxB,+HAAA,gCAAgC,OAAA;AAGlC,kFAAiF;AAAxE,oIAAA,wBAAwB,OAAA;AACjC,sFAGiD;AAF/C,wIAAA,0BAA0B,OAAA;AAG5B,8FAA6F;AAApF,gJAAA,8BAA8B,OAAA;AACvC,wFAGkD;AAFhD,0IAAA,2BAA2B,OAAA;AAG7B,gGAA+F;AAAtF,kJAAA,+BAA+B,OAAA;AACxC,sFAGiD;AAF/C,wIAAA,0BAA0B,OAAA;AAG5B,8FAA6F;AAApF,gJAAA,8BAA8B,OAAA;AACvC,0EAAyE;AAAhE,4HAAA,oBAAoB,OAAA;AAE7B,yFAKkD;AAJhD,4IAAA,4BAA4B,OAAA;AAM9B,mEAAkG;AAAzF,sHAAA,iBAAiB,OAAA;AAC1B,iFAAgF;AAAvE,oIAAA,wBAAwB,OAAA;AAEjC,yCAAmD;AAA1C,iHAAA,oBAAoB,OAAA;AAE7B,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * An object-oriented command-line parser for TypeScript projects.\n *\n * @packageDocumentation\n */\n\nexport { CommandLineAction, type ICommandLineActionOptions } from './providers/CommandLineAction';\nexport { DynamicCommandLineAction } from './providers/DynamicCommandLineAction';\nexport { ScopedCommandLineAction } from './providers/ScopedCommandLineAction';\nexport {\n AliasCommandLineAction,\n type IAliasCommandLineActionOptions\n} from './providers/AliasCommandLineAction';\n\nexport type {\n IBaseCommandLineDefinition,\n IBaseCommandLineDefinitionWithArgument,\n ICommandLineFlagDefinition,\n ICommandLineStringDefinition,\n ICommandLineStringListDefinition,\n ICommandLineIntegerDefinition,\n ICommandLineIntegerListDefinition,\n ICommandLineChoiceDefinition,\n ICommandLineChoiceListDefinition,\n ICommandLineRemainderDefinition\n} from './parameters/CommandLineDefinition';\n\nexport {\n type CommandLineParameter,\n CommandLineParameterKind,\n CommandLineParameterBase,\n CommandLineParameterWithArgument\n} from './parameters/BaseClasses';\n\nexport { CommandLineFlagParameter } from './parameters/CommandLineFlagParameter';\nexport {\n CommandLineStringParameter,\n type IRequiredCommandLineStringParameter\n} from './parameters/CommandLineStringParameter';\nexport { CommandLineStringListParameter } from './parameters/CommandLineStringListParameter';\nexport {\n CommandLineIntegerParameter,\n type IRequiredCommandLineIntegerParameter\n} from './parameters/CommandLineIntegerParameter';\nexport { CommandLineIntegerListParameter } from './parameters/CommandLineIntegerListParameter';\nexport {\n CommandLineChoiceParameter,\n type IRequiredCommandLineChoiceParameter\n} from './parameters/CommandLineChoiceParameter';\nexport { CommandLineChoiceListParameter } from './parameters/CommandLineChoiceListParameter';\nexport { CommandLineRemainder } from './parameters/CommandLineRemainder';\n\nexport {\n CommandLineParameterProvider,\n type IScopedLongNameParseResult,\n type ICommandLineParserData as _ICommandLineParserData,\n type IRegisterDefinedParametersState as _IRegisterDefinedParametersState\n} from './providers/CommandLineParameterProvider';\n\nexport { CommandLineParser, type ICommandLineParserOptions } from './providers/CommandLineParser';\nexport { DynamicCommandLineParser } from './providers/DynamicCommandLineParser';\n\nexport { CommandLineConstants } from './Constants';\n\nexport { CommandLineHelper } from './CommandLineHelper';\n"]}
|
|
@@ -27,6 +27,9 @@ export declare enum CommandLineParameterKind {
|
|
|
27
27
|
/** Indicates a CommandLineIntegerListParameter */
|
|
28
28
|
IntegerList = 6
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
30
33
|
export type CommandLineParameter = CommandLineChoiceListParameter | CommandLineChoiceParameter | CommandLineFlagParameter | CommandLineIntegerListParameter | CommandLineIntegerParameter | CommandLineStringListParameter | CommandLineStringParameter;
|
|
31
34
|
/**
|
|
32
35
|
* The base class for the various command-line parameter types.
|
|
@@ -122,8 +125,8 @@ export declare abstract class CommandLineParameterWithArgument extends CommandLi
|
|
|
122
125
|
private static _invalidArgumentNameRegExp;
|
|
123
126
|
/** {@inheritDoc IBaseCommandLineDefinitionWithArgument.argumentName} */
|
|
124
127
|
readonly argumentName: string;
|
|
125
|
-
/** {@inheritDoc IBaseCommandLineDefinitionWithArgument.
|
|
126
|
-
readonly
|
|
128
|
+
/** {@inheritDoc IBaseCommandLineDefinitionWithArgument.getCompletionsAsync} */
|
|
129
|
+
readonly getCompletionsAsync: (() => Promise<ReadonlyArray<string> | ReadonlySet<string>>) | undefined;
|
|
127
130
|
/** @internal */
|
|
128
131
|
constructor(definition: IBaseCommandLineDefinitionWithArgument);
|
|
129
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClasses.d.ts","sourceRoot":"","sources":["../../src/parameters/BaseClasses.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EACV,0BAA0B,EAC1B,sCAAsC,EACvC,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,KAAK,EAAE,wBA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,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,GAC5D,SAAS,CAAC;IAEd,gBAAgB;gBACG,UAAU,EAAE,sCAAsC;CAyBtE"}
|
|
@@ -159,7 +159,7 @@ class CommandLineParameterWithArgument extends CommandLineParameterBase {
|
|
|
159
159
|
` Only upper-case letters, numbers, and underscores are allowed.`);
|
|
160
160
|
}
|
|
161
161
|
this.argumentName = definition.argumentName;
|
|
162
|
-
this.
|
|
162
|
+
this.getCompletionsAsync = definition.getCompletionsAsync;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
exports.CommandLineParameterWithArgument = CommandLineParameterWithArgument;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClasses.js","sourceRoot":"","sources":["../../src/parameters/BaseClasses.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAe3D;;;GAGG;AACH,IAAY,wBAeX;AAfD,WAAY,wBAAwB;IAClC,6CAA6C;IAC7C,2EAAM,CAAA;IACN,2CAA2C;IAC3C,uEAAI,CAAA;IACJ,8CAA8C;IAC9C,6EAAO,CAAA;IACP,6CAA6C;IAC7C,2EAAM,CAAA;IACN,iDAAiD;IACjD,mFAAU,CAAA;IACV,iDAAiD;IACjD,mFAAU,CAAA;IACV,kDAAkD;IAClD,qFAAW,CAAA;AACb,CAAC,EAfW,wBAAwB,wCAAxB,wBAAwB,QAenC;AAED;;;GAGG;AACH,MAAM,gBAAgB,GAAW,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,MAAM,iBAAiB,GAAW,aAAa,CAAC;AAEhD;;;GAGG;AACH,MAAM,YAAY,GAAW,0BAA0B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,gCAAgC,GAAW,oBAAoB,CAAC;AAWtE;;;GAGG;AACH,MAAsB,wBAAwB;IAsD5C,gBAAgB;IAChB,YAAmB,UAAsC;QACvD,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,iBAAiB,CAAC;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AACrF,2DAA0B,GAAW,YAAY,CAAC","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';\nimport type {\n IBaseCommandLineDefinition,\n IBaseCommandLineDefinitionWithArgument\n} from './CommandLineDefinition';\nimport type { CommandLineChoiceListParameter } from './CommandLineChoiceListParameter';\nimport type { CommandLineChoiceParameter } from './CommandLineChoiceParameter';\nimport type { CommandLineFlagParameter } from './CommandLineFlagParameter';\nimport type { CommandLineIntegerListParameter } from './CommandLineIntegerListParameter';\nimport type { CommandLineIntegerParameter } from './CommandLineIntegerParameter';\nimport type { CommandLineStringListParameter } from './CommandLineStringListParameter';\nimport type { CommandLineStringParameter } from './CommandLineStringParameter';\n\n/**\n * Identifies the kind of a CommandLineParameter.\n * @public\n */\nexport enum CommandLineParameterKind {\n /** Indicates a CommandLineChoiceParameter */\n Choice,\n /** Indicates a CommandLineFlagParameter */\n Flag,\n /** Indicates a CommandLineIntegerParameter */\n Integer,\n /** Indicates a CommandLineStringParameter */\n String,\n /** Indicates a CommandLineStringListParameter */\n StringList,\n /** Indicates a CommandLineChoiceListParameter */\n ChoiceList,\n /** Indicates a CommandLineIntegerListParameter */\n IntegerList\n}\n\n/**\n * Matches kebab-case formatted strings prefixed with double dashes.\n * Example: \"--do-something\"\n */\nconst LONG_NAME_REGEXP: RegExp = /^-(-[a-z0-9]+)+$/;\n\n/**\n * Matches a single upper-case or lower-case letter prefixed with a dash.\n * Example: \"-d\"\n */\nconst SHORT_NAME_REGEXP: RegExp = /^-[a-zA-Z]$/;\n\n/**\n * Matches kebab-case formatted strings\n * Example: \"my-scope\"\n */\nconst SCOPE_REGEXP: RegExp = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\n/**\n * \"Environment variable names used by the utilities in the Shell and Utilities volume of\n * IEEE Std 1003.1-2001 consist solely of uppercase letters, digits, and the '_' (underscore)\n * from the characters defined in Portable Character Set and do not begin with a digit.\"\n * Example: \"THE_SETTING\"\n */\nconst ENVIRONMENT_VARIABLE_NAME_REGEXP: RegExp = /^[A-Z_][A-Z0-9_]*$/;\n\nexport type CommandLineParameter =\n | CommandLineChoiceListParameter\n | CommandLineChoiceParameter\n | CommandLineFlagParameter\n | CommandLineIntegerListParameter\n | CommandLineIntegerParameter\n | CommandLineStringListParameter\n | CommandLineStringParameter;\n\n/**\n * The base class for the various command-line parameter types.\n * @public\n */\nexport abstract class CommandLineParameterBase {\n private _shortNameValue: string | undefined;\n\n /**\n * A unique internal key used to retrieve the value from the parser's dictionary.\n * @internal\n */\n public _parserKey: string | undefined;\n\n /**\n * @internal\n */\n public _preParse?: () => void;\n\n /**\n * @internal\n */\n public _postParse?: () => void;\n\n /**\n * @internal\n */\n public _validateValue?: () => void;\n\n /** {@inheritDoc IBaseCommandLineDefinition.parameterLongName} */\n public readonly longName: string;\n\n /**\n * If a parameterScope is provided, returns the scope-prefixed long name of the flag,\n * including double dashes, eg. \"--scope:do-something\". Otherwise undefined.\n */\n public readonly scopedLongName: string | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.parameterGroup} */\n public readonly parameterGroup: string | typeof SCOPING_PARAMETER_GROUP | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.parameterScope} */\n public readonly parameterScope: string | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.description} */\n public readonly description: string;\n\n /** {@inheritDoc IBaseCommandLineDefinition.required} */\n public readonly required: boolean;\n\n /** {@inheritDoc IBaseCommandLineDefinition.environmentVariable} */\n public readonly environmentVariable: string | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.allowNonStandardEnvironmentVariableNames} */\n public readonly allowNonStandardEnvironmentVariableNames: boolean | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.undocumentedSynonyms } */\n public readonly undocumentedSynonyms: string[] | undefined;\n\n /** @internal */\n public constructor(definition: IBaseCommandLineDefinition) {\n this.longName = definition.parameterLongName;\n this._shortNameValue = definition.parameterShortName;\n this.parameterGroup = definition.parameterGroup;\n this.parameterScope = definition.parameterScope;\n this.description = definition.description;\n this.required = !!definition.required;\n this.environmentVariable = definition.environmentVariable;\n this.undocumentedSynonyms = definition.undocumentedSynonyms;\n this.allowNonStandardEnvironmentVariableNames = definition.allowNonStandardEnvironmentVariableNames;\n\n if (!LONG_NAME_REGEXP.test(this.longName)) {\n throw new Error(\n `Invalid name: \"${this.longName}\". The parameter long name must be` +\n ` lower-case and use dash delimiters (e.g. \"--do-a-thing\")`\n );\n }\n\n if (this.shortName) {\n if (!SHORT_NAME_REGEXP.test(this.shortName)) {\n throw new Error(\n `Invalid name: \"${this.shortName}\". The parameter short name must be` +\n ` a dash followed by a single upper-case or lower-case letter (e.g. \"-a\")`\n );\n }\n }\n\n if (this.parameterScope) {\n if (!SCOPE_REGEXP.test(this.parameterScope)) {\n throw new Error(\n `Invalid scope: \"${this.parameterScope}\". The parameter scope name must be` +\n ` lower-case and use dash delimiters (e.g. \"my-scope\")`\n );\n }\n // Parameter long name is guaranteed to start with '--' since this is validated above\n const unprefixedLongName: string = this.longName.slice(2);\n this.scopedLongName = `--${this.parameterScope}:${unprefixedLongName}`;\n }\n\n if (this.environmentVariable) {\n if (\n !this.allowNonStandardEnvironmentVariableNames &&\n !ENVIRONMENT_VARIABLE_NAME_REGEXP.test(this.environmentVariable)\n ) {\n throw new Error(\n `Invalid environment variable name: \"${this.environmentVariable}\". The name must` +\n ` consist only of upper-case letters, numbers, and underscores. It may not start with a number.`\n );\n }\n }\n\n if (this.undocumentedSynonyms && this.undocumentedSynonyms.length > 0) {\n for (const undocumentedSynonym of this.undocumentedSynonyms) {\n if (this.longName === undocumentedSynonym) {\n throw new Error(\n `Invalid name: \"${undocumentedSynonym}\". Undocumented synonyms must not be the same` +\n ` as the the long name.`\n );\n } else if (!LONG_NAME_REGEXP.test(undocumentedSynonym)) {\n throw new Error(\n `Invalid name: \"${undocumentedSynonym}\". All undocumented synonyms name must be lower-case and ` +\n 'use dash delimiters (e.g. \"--do-a-thing\")'\n );\n }\n }\n }\n }\n\n /** {@inheritDoc IBaseCommandLineDefinition.parameterShortName} */\n public get shortName(): string | undefined {\n return this._shortNameValue;\n }\n\n /**\n * Called internally by CommandLineParameterProvider._processParsedData()\n * @internal\n */\n public abstract _setValue(data: unknown): void;\n\n /**\n * Returns additional text used by the help formatter.\n * @internal\n */\n public _getSupplementaryNotes(supplementaryNotes: string[]): void {\n // virtual\n if (this.environmentVariable !== undefined) {\n supplementaryNotes.push(\n 'This parameter may alternatively be specified via the ' +\n this.environmentVariable +\n ' environment variable.'\n );\n }\n }\n\n /**\n * Indicates the type of parameter.\n */\n public abstract get kind(): CommandLineParameterKind;\n\n /**\n * Append the parsed values to the provided string array.\n * @remarks\n * Sometimes a command line parameter is not used directly, but instead gets passed through to another\n * tool that will use it. For example if our parameter comes in as \"--max-count 3\", then we might want to\n * call `child_process.spawn()` and append [\"--max-count\", \"3\"] to the args array for that tool.\n * appendToArgList() appends zero or more strings to the provided array, based on the input command-line\n * that we parsed.\n *\n * If the parameter was omitted from our command-line and has no default value, then\n * nothing will be appended. If the short name was used, the long name will be appended instead.\n * @param argList - the parsed strings will be appended to this string array\n */\n public abstract appendToArgList(argList: string[]): void;\n\n /**\n * Internal usage only. Used to report unexpected output from the argparse library.\n */\n protected reportInvalidData(data: unknown): never {\n throw new Error(`Unexpected data object for parameter \"${this.longName}\": ` + JSON.stringify(data));\n }\n\n protected validateDefaultValue(hasDefaultValue: boolean): void {\n if (this.required && hasDefaultValue) {\n // If a parameter is \"required\", then the user understands that they always need to\n // specify a value for this parameter (either via the command line or via an environment variable).\n // It would be confusing to allow a default value that sometimes allows the \"required\" parameter\n // to be omitted. If you sometimes don't have a suitable default value, then the better approach\n // is to throw a custom error explaining why the parameter is required in that case.\n throw new Error(\n `A default value cannot be specified for \"${this.longName}\" because it is a \"required\" parameter`\n );\n }\n }\n}\n\n/**\n * The common base class for parameters types that receive 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 abstract class CommandLineParameterWithArgument extends CommandLineParameterBase {\n // Matches the first character that *isn't* part of a valid upper-case argument name such as \"URL_2\"\n private static _invalidArgumentNameRegExp: RegExp = /[^A-Z_0-9]/;\n\n /** {@inheritDoc IBaseCommandLineDefinitionWithArgument.argumentName} */\n public readonly argumentName: string;\n\n /** {@inheritDoc IBaseCommandLineDefinitionWithArgument.completions} */\n public readonly completions: (() => Promise<ReadonlyArray<string> | ReadonlySet<string>>) | undefined;\n\n /** @internal */\n public constructor(definition: IBaseCommandLineDefinitionWithArgument) {\n super(definition);\n\n if (definition.argumentName === '') {\n throw new Error(\n 'The argument name cannot be an empty string. (For the default name, specify undefined.)'\n );\n }\n if (definition.argumentName.toUpperCase() !== definition.argumentName) {\n throw new Error(\n `Invalid name: \"${definition.argumentName}\". The argument name must be all upper case.`\n );\n }\n const match: RegExpMatchArray | null = definition.argumentName.match(\n CommandLineParameterWithArgument._invalidArgumentNameRegExp\n );\n if (match) {\n throw new Error(\n `The argument name \"${definition.argumentName}\" contains an invalid character \"${match[0]}\".` +\n ` Only upper-case letters, numbers, and underscores are allowed.`\n );\n }\n this.argumentName = definition.argumentName;\n this.completions = definition.completions;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BaseClasses.js","sourceRoot":"","sources":["../../src/parameters/BaseClasses.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAe3D;;;GAGG;AACH,IAAY,wBAeX;AAfD,WAAY,wBAAwB;IAClC,6CAA6C;IAC7C,2EAAM,CAAA;IACN,2CAA2C;IAC3C,uEAAI,CAAA;IACJ,8CAA8C;IAC9C,6EAAO,CAAA;IACP,6CAA6C;IAC7C,2EAAM,CAAA;IACN,iDAAiD;IACjD,mFAAU,CAAA;IACV,iDAAiD;IACjD,mFAAU,CAAA;IACV,kDAAkD;IAClD,qFAAW,CAAA;AACb,CAAC,EAfW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YAAY,CAAC,KAAK,CAClE,gCAAgC,CAAC,0BAA0B,CAC5D,CAAC;QACF,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,sBAAsB,UAAU,CAAC,YAAY,oCAAoC,KAAK,CAAC,CAAC,CAAC,IAAI;gBAC3F,iEAAiE,CACpE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,mBAAmB,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAC5D,CAAC;;AArCH,4EAsCC;AArCC,oGAAoG;AACrF,2DAA0B,GAAW,YAAY,CAAC","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';\nimport type {\n IBaseCommandLineDefinition,\n IBaseCommandLineDefinitionWithArgument\n} from './CommandLineDefinition';\nimport type { CommandLineChoiceListParameter } from './CommandLineChoiceListParameter';\nimport type { CommandLineChoiceParameter } from './CommandLineChoiceParameter';\nimport type { CommandLineFlagParameter } from './CommandLineFlagParameter';\nimport type { CommandLineIntegerListParameter } from './CommandLineIntegerListParameter';\nimport type { CommandLineIntegerParameter } from './CommandLineIntegerParameter';\nimport type { CommandLineStringListParameter } from './CommandLineStringListParameter';\nimport type { CommandLineStringParameter } from './CommandLineStringParameter';\n\n/**\n * Identifies the kind of a CommandLineParameter.\n * @public\n */\nexport enum CommandLineParameterKind {\n /** Indicates a CommandLineChoiceParameter */\n Choice,\n /** Indicates a CommandLineFlagParameter */\n Flag,\n /** Indicates a CommandLineIntegerParameter */\n Integer,\n /** Indicates a CommandLineStringParameter */\n String,\n /** Indicates a CommandLineStringListParameter */\n StringList,\n /** Indicates a CommandLineChoiceListParameter */\n ChoiceList,\n /** Indicates a CommandLineIntegerListParameter */\n IntegerList\n}\n\n/**\n * Matches kebab-case formatted strings prefixed with double dashes.\n * Example: \"--do-something\"\n */\nconst LONG_NAME_REGEXP: RegExp = /^-(-[a-z0-9]+)+$/;\n\n/**\n * Matches a single upper-case or lower-case letter prefixed with a dash.\n * Example: \"-d\"\n */\nconst SHORT_NAME_REGEXP: RegExp = /^-[a-zA-Z]$/;\n\n/**\n * Matches kebab-case formatted strings\n * Example: \"my-scope\"\n */\nconst SCOPE_REGEXP: RegExp = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\n/**\n * \"Environment variable names used by the utilities in the Shell and Utilities volume of\n * IEEE Std 1003.1-2001 consist solely of uppercase letters, digits, and the '_' (underscore)\n * from the characters defined in Portable Character Set and do not begin with a digit.\"\n * Example: \"THE_SETTING\"\n */\nconst ENVIRONMENT_VARIABLE_NAME_REGEXP: RegExp = /^[A-Z_][A-Z0-9_]*$/;\n\n/**\n * @public\n */\nexport type CommandLineParameter =\n | CommandLineChoiceListParameter\n | CommandLineChoiceParameter\n | CommandLineFlagParameter\n | CommandLineIntegerListParameter\n | CommandLineIntegerParameter\n | CommandLineStringListParameter\n | CommandLineStringParameter;\n\n/**\n * The base class for the various command-line parameter types.\n * @public\n */\nexport abstract class CommandLineParameterBase {\n private _shortNameValue: string | undefined;\n\n /**\n * A unique internal key used to retrieve the value from the parser's dictionary.\n * @internal\n */\n public _parserKey: string | undefined;\n\n /**\n * @internal\n */\n public _preParse?: () => void;\n\n /**\n * @internal\n */\n public _postParse?: () => void;\n\n /**\n * @internal\n */\n public _validateValue?: () => void;\n\n /** {@inheritDoc IBaseCommandLineDefinition.parameterLongName} */\n public readonly longName: string;\n\n /**\n * If a parameterScope is provided, returns the scope-prefixed long name of the flag,\n * including double dashes, eg. \"--scope:do-something\". Otherwise undefined.\n */\n public readonly scopedLongName: string | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.parameterGroup} */\n public readonly parameterGroup: string | typeof SCOPING_PARAMETER_GROUP | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.parameterScope} */\n public readonly parameterScope: string | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.description} */\n public readonly description: string;\n\n /** {@inheritDoc IBaseCommandLineDefinition.required} */\n public readonly required: boolean;\n\n /** {@inheritDoc IBaseCommandLineDefinition.environmentVariable} */\n public readonly environmentVariable: string | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.allowNonStandardEnvironmentVariableNames} */\n public readonly allowNonStandardEnvironmentVariableNames: boolean | undefined;\n\n /** {@inheritDoc IBaseCommandLineDefinition.undocumentedSynonyms } */\n public readonly undocumentedSynonyms: string[] | undefined;\n\n /** @internal */\n public constructor(definition: IBaseCommandLineDefinition) {\n this.longName = definition.parameterLongName;\n this._shortNameValue = definition.parameterShortName;\n this.parameterGroup = definition.parameterGroup;\n this.parameterScope = definition.parameterScope;\n this.description = definition.description;\n this.required = !!definition.required;\n this.environmentVariable = definition.environmentVariable;\n this.undocumentedSynonyms = definition.undocumentedSynonyms;\n this.allowNonStandardEnvironmentVariableNames = definition.allowNonStandardEnvironmentVariableNames;\n\n if (!LONG_NAME_REGEXP.test(this.longName)) {\n throw new Error(\n `Invalid name: \"${this.longName}\". The parameter long name must be` +\n ` lower-case and use dash delimiters (e.g. \"--do-a-thing\")`\n );\n }\n\n if (this.shortName) {\n if (!SHORT_NAME_REGEXP.test(this.shortName)) {\n throw new Error(\n `Invalid name: \"${this.shortName}\". The parameter short name must be` +\n ` a dash followed by a single upper-case or lower-case letter (e.g. \"-a\")`\n );\n }\n }\n\n if (this.parameterScope) {\n if (!SCOPE_REGEXP.test(this.parameterScope)) {\n throw new Error(\n `Invalid scope: \"${this.parameterScope}\". The parameter scope name must be` +\n ` lower-case and use dash delimiters (e.g. \"my-scope\")`\n );\n }\n // Parameter long name is guaranteed to start with '--' since this is validated above\n const unprefixedLongName: string = this.longName.slice(2);\n this.scopedLongName = `--${this.parameterScope}:${unprefixedLongName}`;\n }\n\n if (this.environmentVariable) {\n if (\n !this.allowNonStandardEnvironmentVariableNames &&\n !ENVIRONMENT_VARIABLE_NAME_REGEXP.test(this.environmentVariable)\n ) {\n throw new Error(\n `Invalid environment variable name: \"${this.environmentVariable}\". The name must` +\n ` consist only of upper-case letters, numbers, and underscores. It may not start with a number.`\n );\n }\n }\n\n if (this.undocumentedSynonyms && this.undocumentedSynonyms.length > 0) {\n for (const undocumentedSynonym of this.undocumentedSynonyms) {\n if (this.longName === undocumentedSynonym) {\n throw new Error(\n `Invalid name: \"${undocumentedSynonym}\". Undocumented synonyms must not be the same` +\n ` as the the long name.`\n );\n } else if (!LONG_NAME_REGEXP.test(undocumentedSynonym)) {\n throw new Error(\n `Invalid name: \"${undocumentedSynonym}\". All undocumented synonyms name must be lower-case and ` +\n 'use dash delimiters (e.g. \"--do-a-thing\")'\n );\n }\n }\n }\n }\n\n /** {@inheritDoc IBaseCommandLineDefinition.parameterShortName} */\n public get shortName(): string | undefined {\n return this._shortNameValue;\n }\n\n /**\n * Called internally by CommandLineParameterProvider._processParsedData()\n * @internal\n */\n public abstract _setValue(data: unknown): void;\n\n /**\n * Returns additional text used by the help formatter.\n * @internal\n */\n public _getSupplementaryNotes(supplementaryNotes: string[]): void {\n // virtual\n if (this.environmentVariable !== undefined) {\n supplementaryNotes.push(\n 'This parameter may alternatively be specified via the ' +\n this.environmentVariable +\n ' environment variable.'\n );\n }\n }\n\n /**\n * Indicates the type of parameter.\n */\n public abstract get kind(): CommandLineParameterKind;\n\n /**\n * Append the parsed values to the provided string array.\n * @remarks\n * Sometimes a command line parameter is not used directly, but instead gets passed through to another\n * tool that will use it. For example if our parameter comes in as \"--max-count 3\", then we might want to\n * call `child_process.spawn()` and append [\"--max-count\", \"3\"] to the args array for that tool.\n * appendToArgList() appends zero or more strings to the provided array, based on the input command-line\n * that we parsed.\n *\n * If the parameter was omitted from our command-line and has no default value, then\n * nothing will be appended. If the short name was used, the long name will be appended instead.\n * @param argList - the parsed strings will be appended to this string array\n */\n public abstract appendToArgList(argList: string[]): void;\n\n /**\n * Internal usage only. Used to report unexpected output from the argparse library.\n */\n protected reportInvalidData(data: unknown): never {\n throw new Error(`Unexpected data object for parameter \"${this.longName}\": ` + JSON.stringify(data));\n }\n\n protected validateDefaultValue(hasDefaultValue: boolean): void {\n if (this.required && hasDefaultValue) {\n // If a parameter is \"required\", then the user understands that they always need to\n // specify a value for this parameter (either via the command line or via an environment variable).\n // It would be confusing to allow a default value that sometimes allows the \"required\" parameter\n // to be omitted. If you sometimes don't have a suitable default value, then the better approach\n // is to throw a custom error explaining why the parameter is required in that case.\n throw new Error(\n `A default value cannot be specified for \"${this.longName}\" because it is a \"required\" parameter`\n );\n }\n }\n}\n\n/**\n * The common base class for parameters types that receive 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 abstract class CommandLineParameterWithArgument extends CommandLineParameterBase {\n // Matches the first character that *isn't* part of a valid upper-case argument name such as \"URL_2\"\n private static _invalidArgumentNameRegExp: RegExp = /[^A-Z_0-9]/;\n\n /** {@inheritDoc IBaseCommandLineDefinitionWithArgument.argumentName} */\n public readonly argumentName: string;\n\n /** {@inheritDoc IBaseCommandLineDefinitionWithArgument.getCompletionsAsync} */\n public readonly getCompletionsAsync:\n | (() => Promise<ReadonlyArray<string> | ReadonlySet<string>>)\n | undefined;\n\n /** @internal */\n public constructor(definition: IBaseCommandLineDefinitionWithArgument) {\n super(definition);\n\n if (definition.argumentName === '') {\n throw new Error(\n 'The argument name cannot be an empty string. (For the default name, specify undefined.)'\n );\n }\n if (definition.argumentName.toUpperCase() !== definition.argumentName) {\n throw new Error(\n `Invalid name: \"${definition.argumentName}\". The argument name must be all upper case.`\n );\n }\n const match: RegExpMatchArray | null = definition.argumentName.match(\n CommandLineParameterWithArgument._invalidArgumentNameRegExp\n );\n if (match) {\n throw new Error(\n `The argument name \"${definition.argumentName}\" contains an invalid character \"${match[0]}\".` +\n ` Only upper-case letters, numbers, and underscores are allowed.`\n );\n }\n this.argumentName = definition.argumentName;\n this.getCompletionsAsync = definition.getCompletionsAsync;\n }\n}\n"]}
|
|
@@ -10,12 +10,12 @@ export declare class CommandLineChoiceListParameter<TChoice extends string = str
|
|
|
10
10
|
private _values;
|
|
11
11
|
/** {@inheritDoc ICommandLineChoiceListDefinition.completions} */
|
|
12
12
|
readonly completions: (() => Promise<ReadonlyArray<TChoice> | ReadonlySet<TChoice>>) | undefined;
|
|
13
|
-
/** {@inheritDoc
|
|
13
|
+
/** {@inheritDoc CommandLineParameterBase.kind} */
|
|
14
14
|
readonly kind: CommandLineParameterKind.ChoiceList;
|
|
15
15
|
/** @internal */
|
|
16
16
|
constructor(definition: ICommandLineChoiceListDefinition<TChoice>);
|
|
17
17
|
/**
|
|
18
|
-
* {@inheritDoc
|
|
18
|
+
* {@inheritDoc CommandLineParameterBase._setValue}
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
_setValue(data: unknown): void;
|
|
@@ -27,7 +27,7 @@ export declare class CommandLineChoiceListParameter<TChoice extends string = str
|
|
|
27
27
|
* or if the parameter was omitted and has no default value.
|
|
28
28
|
*/
|
|
29
29
|
get values(): ReadonlyArray<TChoice>;
|
|
30
|
-
/** {@inheritDoc
|
|
30
|
+
/** {@inheritDoc CommandLineParameterBase.appendToArgList} @override */
|
|
31
31
|
appendToArgList(argList: string[]): void;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=CommandLineChoiceListParameter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineChoiceListParameter.d.ts","sourceRoot":"","sources":["../../src/parameters/CommandLineChoiceListParameter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAGnF;;;GAGG;AACH,qBAAa,8BAA8B,CACzC,OAAO,SAAS,MAAM,GAAG,MAAM,CAC/B,SAAQ,wBAAwB;IAChC,kEAAkE;IAClE,SAAgB,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAEnD,OAAO,CAAC,OAAO,CAAiB;IAEhC,iEAAiE;IACjE,SAAgB,WAAW,EAAE,CAAC,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAExG,
|
|
1
|
+
{"version":3,"file":"CommandLineChoiceListParameter.d.ts","sourceRoot":"","sources":["../../src/parameters/CommandLineChoiceListParameter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAGnF;;;GAGG;AACH,qBAAa,8BAA8B,CACzC,OAAO,SAAS,MAAM,GAAG,MAAM,CAC/B,SAAQ,wBAAwB;IAChC,kEAAkE;IAClE,SAAgB,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAEnD,OAAO,CAAC,OAAO,CAAiB;IAEhC,iEAAiE;IACjE,SAAgB,WAAW,EAAE,CAAC,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAExG,kDAAkD;IAClD,SAAgB,IAAI,EAAE,wBAAwB,CAAC,UAAU,CAAuC;IAEhG,gBAAgB;gBACG,UAAU,EAAE,gCAAgC,CAAC,OAAO,CAAC;IAexE;;;OAGG;IACI,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAsCrC;;;;;;OAMG;IACH,IAAW,MAAM,IAAI,aAAa,CAAC,OAAO,CAAC,CAE1C;IAED,uEAAuE;IAChE,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;CAQhD"}
|