@rushstack/ts-command-line 4.18.1 → 4.19.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 +49 -22
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/parameters/BaseClasses.d.ts +24 -4
- package/lib/parameters/BaseClasses.d.ts.map +1 -1
- package/lib/parameters/BaseClasses.js +5 -11
- 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 +3 -6
- package/lib/parameters/CommandLineChoiceListParameter.js.map +1 -1
- package/lib/parameters/CommandLineChoiceParameter.d.ts +6 -6
- package/lib/parameters/CommandLineChoiceParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineChoiceParameter.js +3 -6
- package/lib/parameters/CommandLineChoiceParameter.js.map +1 -1
- package/lib/parameters/CommandLineDefinition.d.ts +0 -3
- package/lib/parameters/CommandLineDefinition.d.ts.map +1 -1
- package/lib/parameters/CommandLineDefinition.js.map +1 -1
- package/lib/parameters/CommandLineFlagParameter.d.ts +5 -5
- package/lib/parameters/CommandLineFlagParameter.d.ts.map +1 -1
- package/lib/parameters/CommandLineFlagParameter.js +3 -6
- 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 +2 -5
- 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 +2 -5
- package/lib/parameters/CommandLineIntegerParameter.js.map +1 -1
- package/lib/parameters/CommandLineRemainder.d.ts +1 -1
- package/lib/parameters/CommandLineRemainder.d.ts.map +1 -1
- package/lib/parameters/CommandLineRemainder.js +0 -1
- 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 +2 -5
- 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 +2 -5
- 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 +13 -19
- package/lib/providers/AliasCommandLineAction.js.map +1 -1
- package/lib/providers/CommandLineAction.d.ts +2 -8
- package/lib/providers/CommandLineAction.d.ts.map +1 -1
- package/lib/providers/CommandLineAction.js +0 -7
- package/lib/providers/CommandLineAction.js.map +1 -1
- package/lib/providers/CommandLineParameterProvider.d.ts +38 -4
- package/lib/providers/CommandLineParameterProvider.d.ts.map +1 -1
- package/lib/providers/CommandLineParameterProvider.js +118 -43
- package/lib/providers/CommandLineParameterProvider.js.map +1 -1
- package/lib/providers/CommandLineParser.d.ts.map +1 -1
- package/lib/providers/CommandLineParser.js +20 -0
- package/lib/providers/CommandLineParser.js.map +1 -1
- package/lib/providers/ScopedCommandLineAction.d.ts +6 -3
- package/lib/providers/ScopedCommandLineAction.d.ts.map +1 -1
- package/lib/providers/ScopedCommandLineAction.js +4 -1
- package/lib/providers/ScopedCommandLineAction.js.map +1 -1
- package/lib/providers/TabCompletionAction.d.ts +2 -2
- package/lib/providers/TabCompletionAction.d.ts.map +1 -1
- package/lib/providers/TabCompletionAction.js +5 -7
- package/lib/providers/TabCompletionAction.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,18 +13,15 @@ class CommandLineStringParameter extends BaseClasses_1.CommandLineParameterWithA
|
|
|
13
13
|
constructor(definition) {
|
|
14
14
|
super(definition);
|
|
15
15
|
this._value = undefined;
|
|
16
|
+
/** {@inheritDoc CommandLineParameter.kind} */
|
|
17
|
+
this.kind = BaseClasses_1.CommandLineParameterKind.String;
|
|
16
18
|
this.defaultValue = definition.defaultValue;
|
|
17
19
|
this.validateDefaultValue(!!this.defaultValue);
|
|
18
20
|
}
|
|
19
|
-
/** {@inheritDoc CommandLineParameter.kind} */
|
|
20
|
-
get kind() {
|
|
21
|
-
return BaseClasses_1.CommandLineParameterKind.String;
|
|
22
|
-
}
|
|
23
21
|
/**
|
|
24
22
|
* {@inheritDoc CommandLineParameter._setValue}
|
|
25
23
|
* @internal
|
|
26
24
|
*/
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
25
|
_setValue(data) {
|
|
29
26
|
// abstract
|
|
30
27
|
if (data !== null && data !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;IAS9E,gBAAgB;IAChB,YAAmB,UAAwC;QACzD,KAAK,CAAC,UAAU,CAAC,CAAC;QAPZ,WAAM,GAAuB,SAAS,CAAC;QAE/C,8CAA8C;QAC9B,SAAI,GAAoC,sCAAwB,CAAC,MAAM,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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;AAlFD,gEAkFC","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 readonly 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 /** {@inheritDoc CommandLineParameter.kind} */\n public readonly kind: CommandLineParameterKind.String = CommandLineParameterKind.String;\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 /**\n * {@inheritDoc CommandLineParameter._setValue}\n * @internal\n */\n public _setValue(data: unknown): 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"]}
|
|
@@ -48,7 +48,7 @@ export declare class AliasCommandLineAction extends CommandLineAction {
|
|
|
48
48
|
/** @internal */
|
|
49
49
|
_registerDefinedParameters(state: IRegisterDefinedParametersState): void;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* {@inheritdoc CommandLineParameterProvider._processParsedData}
|
|
52
52
|
* @internal
|
|
53
53
|
*/
|
|
54
54
|
_processParsedData(parserOptions: ICommandLineParserOptions, data: ICommandLineParserData): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AliasCommandLineAction.d.ts","sourceRoot":"","sources":["../../src/providers/AliasCommandLineAction.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"AliasCommandLineAction.d.ts","sourceRoot":"","sources":["../../src/providers/AliasCommandLineAction.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE7B;;OAEG;IACH,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED;;;;;;;;;GASG;AACH,qBAAa,sBAAuB,SAAQ,iBAAiB;IAC3D;;OAEG;IACH,SAAgB,YAAY,EAAE,iBAAiB,CAAC;IAEhD;;OAEG;IACH,SAAgB,iBAAiB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAEzD,OAAO,CAAC,gBAAgB,CAAkC;gBAEvC,OAAO,EAAE,8BAA8B;IAoB1D,gBAAgB;IACT,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,GAAG,IAAI;IA4E/E;;;OAGG;IACI,kBAAkB,CAAC,aAAa,EAAE,yBAAyB,EAAE,IAAI,EAAE,sBAAsB,GAAG,IAAI;IAmBvG;;OAEG;cACa,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAG3C"}
|
|
@@ -61,42 +61,36 @@ class AliasCommandLineAction extends CommandLineAction_1.CommandLineAction {
|
|
|
61
61
|
// All parameters are going to be defined by the target action. Re-use the target action parameters
|
|
62
62
|
// for this action.
|
|
63
63
|
for (const parameter of this.targetAction.parameters) {
|
|
64
|
+
const { kind, longName, shortName } = parameter;
|
|
64
65
|
let aliasParameter;
|
|
65
66
|
const nameOptions = {
|
|
66
|
-
parameterLongName:
|
|
67
|
-
parameterShortName:
|
|
67
|
+
parameterLongName: longName,
|
|
68
|
+
parameterShortName: shortName
|
|
68
69
|
};
|
|
69
|
-
switch (
|
|
70
|
+
switch (kind) {
|
|
70
71
|
case BaseClasses_1.CommandLineParameterKind.Choice:
|
|
71
|
-
|
|
72
|
-
aliasParameter = this.defineChoiceParameter(Object.assign(Object.assign(Object.assign({}, nameOptions), choiceParameter), { alternatives: [].concat(choiceParameter.alternatives) }));
|
|
72
|
+
aliasParameter = this.defineChoiceParameter(Object.assign(Object.assign(Object.assign({}, nameOptions), parameter), { alternatives: [...parameter.alternatives] }));
|
|
73
73
|
break;
|
|
74
74
|
case BaseClasses_1.CommandLineParameterKind.ChoiceList:
|
|
75
|
-
|
|
76
|
-
aliasParameter = this.defineChoiceListParameter(Object.assign(Object.assign(Object.assign({}, nameOptions), choiceListParameter), { alternatives: [].concat(choiceListParameter.alternatives) }));
|
|
75
|
+
aliasParameter = this.defineChoiceListParameter(Object.assign(Object.assign(Object.assign({}, nameOptions), parameter), { alternatives: [...parameter.alternatives] }));
|
|
77
76
|
break;
|
|
78
77
|
case BaseClasses_1.CommandLineParameterKind.Flag:
|
|
79
|
-
|
|
80
|
-
aliasParameter = this.defineFlagParameter(Object.assign(Object.assign({}, nameOptions), flagParameter));
|
|
78
|
+
aliasParameter = this.defineFlagParameter(Object.assign(Object.assign({}, nameOptions), parameter));
|
|
81
79
|
break;
|
|
82
80
|
case BaseClasses_1.CommandLineParameterKind.Integer:
|
|
83
|
-
|
|
84
|
-
aliasParameter = this.defineIntegerParameter(Object.assign(Object.assign({}, nameOptions), integerParameter));
|
|
81
|
+
aliasParameter = this.defineIntegerParameter(Object.assign(Object.assign({}, nameOptions), parameter));
|
|
85
82
|
break;
|
|
86
83
|
case BaseClasses_1.CommandLineParameterKind.IntegerList:
|
|
87
|
-
|
|
88
|
-
aliasParameter = this.defineIntegerListParameter(Object.assign(Object.assign({}, nameOptions), integerListParameter));
|
|
84
|
+
aliasParameter = this.defineIntegerListParameter(Object.assign(Object.assign({}, nameOptions), parameter));
|
|
89
85
|
break;
|
|
90
86
|
case BaseClasses_1.CommandLineParameterKind.String:
|
|
91
|
-
|
|
92
|
-
aliasParameter = this.defineStringParameter(Object.assign(Object.assign({}, nameOptions), stringParameter));
|
|
87
|
+
aliasParameter = this.defineStringParameter(Object.assign(Object.assign({}, nameOptions), parameter));
|
|
93
88
|
break;
|
|
94
89
|
case BaseClasses_1.CommandLineParameterKind.StringList:
|
|
95
|
-
|
|
96
|
-
aliasParameter = this.defineStringListParameter(Object.assign(Object.assign({}, nameOptions), stringListParameter));
|
|
90
|
+
aliasParameter = this.defineStringListParameter(Object.assign(Object.assign({}, nameOptions), parameter));
|
|
97
91
|
break;
|
|
98
92
|
default:
|
|
99
|
-
throw new Error(`Unsupported parameter kind: ${
|
|
93
|
+
throw new Error(`Unsupported parameter kind: ${kind}`);
|
|
100
94
|
}
|
|
101
95
|
// We know the parserKey is defined because the underlying _defineParameter method sets it,
|
|
102
96
|
// and all parameters that we have access to have already been defined.
|
|
@@ -124,7 +118,7 @@ class AliasCommandLineAction extends CommandLineAction_1.CommandLineAction {
|
|
|
124
118
|
}
|
|
125
119
|
}
|
|
126
120
|
/**
|
|
127
|
-
*
|
|
121
|
+
* {@inheritdoc CommandLineParameterProvider._processParsedData}
|
|
128
122
|
* @internal
|
|
129
123
|
*/
|
|
130
124
|
_processParsedData(parserOptions, data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AliasCommandLineAction.js","sourceRoot":"","sources":["../../src/providers/AliasCommandLineAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,mDAAqC;AAErC,2DAAwD;AACxD,2DAAgG;AAqChG;;;;;;;;;GASG;AACH,MAAa,sBAAuB,SAAQ,qCAAiB;IAa3D,YAAmB,OAAuC;QACxD,MAAM,YAAY,GAAW,OAAO,CAAC,YAAY,CAAC;QAClD,MAAM,gBAAgB,GA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,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACrB,SAAS;YACX,CAAC;YACD,MAAM,SAAS,GAAuB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACrE,UAAU,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,GAAG,CAAC,GAAG,KAAK,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,SAAS;QACvB,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;IACrC,CAAC;CACF;AAnJD,wDAmJC","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 * as argparse from 'argparse';\n\nimport { CommandLineAction } from './CommandLineAction';\nimport { CommandLineParameterKind, type CommandLineParameter } from '../parameters/BaseClasses';\nimport type { ICommandLineParserData, IRegisterDefinedParametersState } from './CommandLineParameterProvider';\nimport type { ICommandLineParserOptions } from './CommandLineParser';\nimport type { CommandLineChoiceParameter } from '../parameters/CommandLineChoiceParameter';\nimport type { CommandLineFlagParameter } from '../parameters/CommandLineFlagParameter';\nimport type { CommandLineStringParameter } from '../parameters/CommandLineStringParameter';\nimport type { CommandLineIntegerParameter } from '../parameters/CommandLineIntegerParameter';\nimport type { CommandLineChoiceListParameter } from '../parameters/CommandLineChoiceListParameter';\nimport type { CommandLineIntegerListParameter } from '../parameters/CommandLineIntegerListParameter';\n\n/**\n * Options for the AliasCommandLineAction constructor.\n * @public\n */\nexport interface IAliasCommandLineActionOptions {\n /**\n * The name of your tool when invoked from the command line. Used for generating help text.\n */\n toolFilename: string;\n\n /**\n * The name of the alias. For example, if the tool is called \"example\",\n * then the \"build\" alias might be invoked as: \"example build -q --some-other-option\"\n */\n aliasName: string;\n\n /**\n * A list of default parameters to pass to the target action.\n */\n defaultParameters?: string[];\n\n /**\n * The action that this alias invokes.\n */\n targetAction: CommandLineAction;\n}\n\n/**\n * Represents a sub-command that is part of the CommandLineParser command line.\n * The sub-command is an alias for another existing action.\n *\n * The alias name should be comprised of lower case words separated by hyphens\n * or colons. The name should include an English verb (e.g. \"deploy\"). Use a\n * hyphen to separate words (e.g. \"upload-docs\").\n *\n * @public\n */\nexport class AliasCommandLineAction extends CommandLineAction {\n /**\n * The action that this alias invokes.\n */\n public readonly targetAction: CommandLineAction;\n\n /**\n * A list of default arguments to pass to the target action.\n */\n public readonly defaultParameters: ReadonlyArray<string>;\n\n private _parameterKeyMap: Map<string, string> = new Map();\n\n public constructor(options: IAliasCommandLineActionOptions) {\n const toolFilename: string = options.toolFilename;\n const targetActionName: string = options.targetAction.actionName;\n const defaultParametersString: string = (options.defaultParameters || []).join(' ');\n const summary: string = `An alias for \"${toolFilename} ${targetActionName}${\n defaultParametersString ? ` ${defaultParametersString}` : ''\n }\".`;\n\n super({\n actionName: options.aliasName,\n summary,\n documentation:\n `${summary} For more information on the aliased command, use ` +\n `\"${toolFilename} ${targetActionName} --help\".`\n });\n\n this.targetAction = options.targetAction;\n this.defaultParameters = options.defaultParameters || [];\n }\n\n /** @internal */\n public _registerDefinedParameters(state: IRegisterDefinedParametersState): void {\n /* override */\n // All parameters are going to be defined by the target action. Re-use the target action parameters\n // for this action.\n for (const parameter of this.targetAction.parameters) {\n let aliasParameter: CommandLineParameter;\n const nameOptions: { parameterLongName: string; parameterShortName: string | undefined } = {\n parameterLongName: parameter.longName,\n parameterShortName: parameter.shortName\n };\n switch (parameter.kind) {\n case CommandLineParameterKind.Choice:\n const choiceParameter: CommandLineChoiceParameter = parameter as CommandLineChoiceParameter;\n aliasParameter = this.defineChoiceParameter({\n ...nameOptions,\n ...choiceParameter,\n alternatives: ([] as string[]).concat(choiceParameter.alternatives)\n });\n break;\n case CommandLineParameterKind.ChoiceList:\n const choiceListParameter: CommandLineChoiceListParameter =\n parameter as CommandLineChoiceListParameter;\n aliasParameter = this.defineChoiceListParameter({\n ...nameOptions,\n ...choiceListParameter,\n alternatives: ([] as string[]).concat(choiceListParameter.alternatives)\n });\n break;\n case CommandLineParameterKind.Flag:\n const flagParameter: CommandLineFlagParameter = parameter as CommandLineFlagParameter;\n aliasParameter = this.defineFlagParameter({ ...nameOptions, ...flagParameter });\n break;\n case CommandLineParameterKind.Integer:\n const integerParameter: CommandLineIntegerParameter = parameter as CommandLineIntegerParameter;\n aliasParameter = this.defineIntegerParameter({ ...nameOptions, ...integerParameter });\n break;\n case CommandLineParameterKind.IntegerList:\n const integerListParameter: CommandLineIntegerListParameter =\n parameter as CommandLineIntegerListParameter;\n aliasParameter = this.defineIntegerListParameter({ ...nameOptions, ...integerListParameter });\n break;\n case CommandLineParameterKind.String:\n const stringParameter: CommandLineStringParameter = parameter as CommandLineStringParameter;\n aliasParameter = this.defineStringParameter({ ...nameOptions, ...stringParameter });\n break;\n case CommandLineParameterKind.StringList:\n const stringListParameter: CommandLineStringParameter = parameter as CommandLineStringParameter;\n aliasParameter = this.defineStringListParameter({ ...nameOptions, ...stringListParameter });\n break;\n default:\n throw new Error(`Unsupported parameter kind: ${parameter.kind}`);\n }\n\n // We know the parserKey is defined because the underlying _defineParameter method sets it,\n // and all parameters that we have access to have already been defined.\n this._parameterKeyMap.set(aliasParameter._parserKey!, parameter._parserKey!);\n }\n\n // We also need to register the remainder parameter if the target action has one. The parser\n // key for this parameter is constant.\n if (this.targetAction.remainder) {\n this.defineCommandLineRemainder(this.targetAction.remainder);\n this._parameterKeyMap.set(argparse.Const.REMAINDER, argparse.Const.REMAINDER);\n }\n\n // Finally, register the parameters with the parser. We need to make sure that the target action\n // is registered, since we need to re-use its parameters, and ambiguous parameters are discovered\n // during registration. This will no-op if the target action is already registered.\n this.targetAction._registerDefinedParameters(state);\n super._registerDefinedParameters(state);\n\n // We need to re-map the ambiguous parameters after they are defined by calling\n // super._registerDefinedParameters()\n for (const [ambiguousParameterName, parserKey] of this._ambiguousParameterParserKeysByName) {\n const targetParserKey: string | undefined =\n this.targetAction._ambiguousParameterParserKeysByName.get(ambiguousParameterName);\n\n // If we have a mapping for the specified key, then use it. Otherwise, use the key as-is.\n if (targetParserKey) {\n this._parameterKeyMap.set(parserKey, targetParserKey);\n }\n }\n }\n\n /**\n * This is called internally by CommandLineParser.execute()\n * @internal\n */\n public _processParsedData(parserOptions: ICommandLineParserOptions, data: ICommandLineParserData): void {\n // Re-map the parsed data to the target action's parameters and execute the target action processor.\n const targetData: ICommandLineParserData = {\n action: this.targetAction.actionName,\n aliasAction: data.action,\n aliasDocumentation: this.documentation\n };\n for (const [key, value] of Object.entries(data)) {\n // If we have a mapping for the specified key, then use it. Otherwise, use the key as-is.\n // Skip over the action key though, since we've already re-mapped it to \"aliasAction\"\n if (key === 'action') {\n continue;\n }\n const targetKey: string | undefined = this._parameterKeyMap.get(key);\n targetData[targetKey ?? key] = value;\n }\n this.targetAction._processParsedData(parserOptions, targetData);\n }\n\n /**\n * Executes the target action.\n */\n protected async onExecute(): Promise<void> {\n await this.targetAction._execute();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AliasCommandLineAction.js","sourceRoot":"","sources":["../../src/providers/AliasCommandLineAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,mDAAqC;AAErC,2DAAwD;AACxD,2DAImC;AA+BnC;;;;;;;;;GASG;AACH,MAAa,sBAAuB,SAAQ,qCAAiB;IAa3D,YAAmB,OAAuC;QACxD,MAAM,YAAY,GAAW,OAAO,CAAC,YAAY,CAAC;QAClD,MAAM,gBAAgB,GAAW,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC;QACjE,MAAM,uBAAuB,GAAW,CAAC,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpF,MAAM,OAAO,GAAW,iBAAiB,YAAY,IAAI,gBAAgB,GACvE,uB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+E;QAC/E,qCAAqC;QACrC,KAAK,MAAM,CAAC,sBAAsB,EAAE,SAAS,CAAC,IAAI,IAAI,CAAC,mCAAmC,EAAE,CAAC;YAC3F,MAAM,eAAe,GACnB,IAAI,CAAC,YAAY,CAAC,mCAAmC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YAEpF,yFAAyF;YACzF,IAAI,eAAe,EAAE,CAAC;gBACpB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,kBAAkB,CAAC,aAAwC,EAAE,IAA4B;QAC9F,oGAAoG;QACpG,MAAM,UAAU,GAA2B;YACzC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU;YACpC,WAAW,EAAE,IAAI,CAAC,MAAM;YACxB,kBAAkB,EAAE,IAAI,CAAC,aAAa;SACvC,CAAC;QACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,yFAAyF;YACzF,qFAAqF;YACrF,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACrB,SAAS;YACX,CAAC;YACD,MAAM,SAAS,GAAuB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACrE,UAAU,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,GAAG,CAAC,GAAG,KAAK,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,SAAS;QACvB,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;IACrC,CAAC;CACF;AA3ID,wDA2IC","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 * as argparse from 'argparse';\n\nimport { CommandLineAction } from './CommandLineAction';\nimport {\n CommandLineParameterKind,\n type CommandLineParameterBase,\n type CommandLineParameter\n} from '../parameters/BaseClasses';\nimport type { ICommandLineParserData, IRegisterDefinedParametersState } from './CommandLineParameterProvider';\nimport type { ICommandLineParserOptions } from './CommandLineParser';\n\n/**\n * Options for the AliasCommandLineAction constructor.\n * @public\n */\nexport interface IAliasCommandLineActionOptions {\n /**\n * The name of your tool when invoked from the command line. Used for generating help text.\n */\n toolFilename: string;\n\n /**\n * The name of the alias. For example, if the tool is called \"example\",\n * then the \"build\" alias might be invoked as: \"example build -q --some-other-option\"\n */\n aliasName: string;\n\n /**\n * A list of default parameters to pass to the target action.\n */\n defaultParameters?: string[];\n\n /**\n * The action that this alias invokes.\n */\n targetAction: CommandLineAction;\n}\n\n/**\n * Represents a sub-command that is part of the CommandLineParser command line.\n * The sub-command is an alias for another existing action.\n *\n * The alias name should be comprised of lower case words separated by hyphens\n * or colons. The name should include an English verb (e.g. \"deploy\"). Use a\n * hyphen to separate words (e.g. \"upload-docs\").\n *\n * @public\n */\nexport class AliasCommandLineAction extends CommandLineAction {\n /**\n * The action that this alias invokes.\n */\n public readonly targetAction: CommandLineAction;\n\n /**\n * A list of default arguments to pass to the target action.\n */\n public readonly defaultParameters: ReadonlyArray<string>;\n\n private _parameterKeyMap: Map<string, string> = new Map();\n\n public constructor(options: IAliasCommandLineActionOptions) {\n const toolFilename: string = options.toolFilename;\n const targetActionName: string = options.targetAction.actionName;\n const defaultParametersString: string = (options.defaultParameters || []).join(' ');\n const summary: string = `An alias for \"${toolFilename} ${targetActionName}${\n defaultParametersString ? ` ${defaultParametersString}` : ''\n }\".`;\n\n super({\n actionName: options.aliasName,\n summary,\n documentation:\n `${summary} For more information on the aliased command, use ` +\n `\"${toolFilename} ${targetActionName} --help\".`\n });\n\n this.targetAction = options.targetAction;\n this.defaultParameters = options.defaultParameters || [];\n }\n\n /** @internal */\n public _registerDefinedParameters(state: IRegisterDefinedParametersState): void {\n /* override */\n // All parameters are going to be defined by the target action. Re-use the target action parameters\n // for this action.\n for (const parameter of this.targetAction.parameters as CommandLineParameter[]) {\n const { kind, longName, shortName } = parameter;\n let aliasParameter: CommandLineParameterBase;\n const nameOptions: { parameterLongName: string; parameterShortName: string | undefined } = {\n parameterLongName: longName,\n parameterShortName: shortName\n };\n switch (kind) {\n case CommandLineParameterKind.Choice:\n aliasParameter = this.defineChoiceParameter({\n ...nameOptions,\n ...parameter,\n alternatives: [...parameter.alternatives]\n });\n break;\n case CommandLineParameterKind.ChoiceList:\n aliasParameter = this.defineChoiceListParameter({\n ...nameOptions,\n ...parameter,\n alternatives: [...parameter.alternatives]\n });\n break;\n case CommandLineParameterKind.Flag:\n aliasParameter = this.defineFlagParameter({ ...nameOptions, ...parameter });\n break;\n case CommandLineParameterKind.Integer:\n aliasParameter = this.defineIntegerParameter({ ...nameOptions, ...parameter });\n break;\n case CommandLineParameterKind.IntegerList:\n aliasParameter = this.defineIntegerListParameter({ ...nameOptions, ...parameter });\n break;\n case CommandLineParameterKind.String:\n aliasParameter = this.defineStringParameter({ ...nameOptions, ...parameter });\n break;\n case CommandLineParameterKind.StringList:\n aliasParameter = this.defineStringListParameter({ ...nameOptions, ...parameter });\n break;\n default:\n throw new Error(`Unsupported parameter kind: ${kind}`);\n }\n\n // We know the parserKey is defined because the underlying _defineParameter method sets it,\n // and all parameters that we have access to have already been defined.\n this._parameterKeyMap.set(aliasParameter._parserKey!, parameter._parserKey!);\n }\n\n // We also need to register the remainder parameter if the target action has one. The parser\n // key for this parameter is constant.\n if (this.targetAction.remainder) {\n this.defineCommandLineRemainder(this.targetAction.remainder);\n this._parameterKeyMap.set(argparse.Const.REMAINDER, argparse.Const.REMAINDER);\n }\n\n // Finally, register the parameters with the parser. We need to make sure that the target action\n // is registered, since we need to re-use its parameters, and ambiguous parameters are discovered\n // during registration. This will no-op if the target action is already registered.\n this.targetAction._registerDefinedParameters(state);\n super._registerDefinedParameters(state);\n\n // We need to re-map the ambiguous parameters after they are defined by calling\n // super._registerDefinedParameters()\n for (const [ambiguousParameterName, parserKey] of this._ambiguousParameterParserKeysByName) {\n const targetParserKey: string | undefined =\n this.targetAction._ambiguousParameterParserKeysByName.get(ambiguousParameterName);\n\n // If we have a mapping for the specified key, then use it. Otherwise, use the key as-is.\n if (targetParserKey) {\n this._parameterKeyMap.set(parserKey, targetParserKey);\n }\n }\n }\n\n /**\n * {@inheritdoc CommandLineParameterProvider._processParsedData}\n * @internal\n */\n public _processParsedData(parserOptions: ICommandLineParserOptions, data: ICommandLineParserData): void {\n // Re-map the parsed data to the target action's parameters and execute the target action processor.\n const targetData: ICommandLineParserData = {\n action: this.targetAction.actionName,\n aliasAction: data.action,\n aliasDocumentation: this.documentation\n };\n for (const [key, value] of Object.entries(data)) {\n // If we have a mapping for the specified key, then use it. Otherwise, use the key as-is.\n // Skip over the action key though, since we've already re-mapped it to \"aliasAction\"\n if (key === 'action') {\n continue;\n }\n const targetKey: string | undefined = this._parameterKeyMap.get(key);\n targetData[targetKey ?? key] = value;\n }\n this.targetAction._processParsedData(parserOptions, targetData);\n }\n\n /**\n * Executes the target action.\n */\n protected async onExecute(): Promise<void> {\n await this.targetAction._execute();\n }\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type * as argparse from 'argparse';
|
|
2
|
-
import { CommandLineParameterProvider
|
|
3
|
-
import type { ICommandLineParserOptions } from './CommandLineParser';
|
|
2
|
+
import { CommandLineParameterProvider } from './CommandLineParameterProvider';
|
|
4
3
|
/**
|
|
5
4
|
* Options for the CommandLineAction constructor.
|
|
6
5
|
* @public
|
|
@@ -49,11 +48,6 @@ export declare abstract class CommandLineAction extends CommandLineParameterProv
|
|
|
49
48
|
* @internal
|
|
50
49
|
*/
|
|
51
50
|
_buildParser(actionsSubParser: argparse.SubParser): void;
|
|
52
|
-
/**
|
|
53
|
-
* This is called internally by CommandLineParser.execute()
|
|
54
|
-
* @internal
|
|
55
|
-
*/
|
|
56
|
-
_processParsedData(parserOptions: ICommandLineParserOptions, data: ICommandLineParserData): void;
|
|
57
51
|
/**
|
|
58
52
|
* Invoked by CommandLineParser.onExecute().
|
|
59
53
|
* @internal
|
|
@@ -63,7 +57,7 @@ export declare abstract class CommandLineAction extends CommandLineParameterProv
|
|
|
63
57
|
* {@inheritDoc CommandLineParameterProvider._getArgumentParser}
|
|
64
58
|
* @internal
|
|
65
59
|
*/
|
|
66
|
-
|
|
60
|
+
_getArgumentParser(): argparse.ArgumentParser;
|
|
67
61
|
/**
|
|
68
62
|
* Your subclass should implement this hook to perform the operation.
|
|
69
63
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineAction.d.ts","sourceRoot":"","sources":["../../src/providers/CommandLineAction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,QAAQ,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,4BAA4B,EAAE,
|
|
1
|
+
{"version":3,"file":"CommandLineAction.d.ts","sourceRoot":"","sources":["../../src/providers/CommandLineAction.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,QAAQ,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAG9E;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAOD;;;;;;;;;;;;GAYG;AACH,8BAAsB,iBAAkB,SAAQ,4BAA4B;IAC1E,yDAAyD;IACzD,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC,sDAAsD;IACtD,SAAgB,OAAO,EAAE,MAAM,CAAC;IAEhC,4DAA4D;IAC5D,SAAgB,aAAa,EAAE,MAAM,CAAC;IAEtC,OAAO,CAAC,eAAe,CAAsC;gBAE1C,OAAO,EAAE,yBAAyB;IAiBrD;;;OAGG;IACI,YAAY,CAAC,gBAAgB,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI;IAwB/D;;;OAGG;IACI,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhC;;;OAGG;IACI,kBAAkB,IAAI,QAAQ,CAAC,cAAc;IAUpD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAC9C"}
|
|
@@ -58,13 +58,6 @@ class CommandLineAction extends CommandLineParameterProvider_1.CommandLineParame
|
|
|
58
58
|
};
|
|
59
59
|
(_a = this.onDefineParameters) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
62
|
-
* This is called internally by CommandLineParser.execute()
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
_processParsedData(parserOptions, data) {
|
|
66
|
-
super._processParsedData(parserOptions, data);
|
|
67
|
-
}
|
|
68
61
|
/**
|
|
69
62
|
* Invoked by CommandLineParser.onExecute().
|
|
70
63
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineAction.js","sourceRoot":"","sources":["../../src/providers/CommandLineAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D,
|
|
1
|
+
{"version":3,"file":"CommandLineAction.js","sourceRoot":"","sources":["../../src/providers/CommandLineAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D,iFAA8E;AAC9E,6EAA0E;AA0B1E;;GAEG;AACH,MAAM,kBAAkB,GAAW,kCAAkC,CAAC;AAEtE;;;;;;;;;;;;GAYG;AACH,MAAsB,iBAAkB,SAAQ,2DAA4B;IAY1E,YAAmB,OAAkC;QACnD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,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AI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,qCAAqC;YACrC,MAAM,IAAI,KAAK,CAAC,kFAAkF,CAAC,CAAC;QACtG,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;CAMF;AAnFD,8CAmFC","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 * as argparse from 'argparse';\n\nimport { CommandLineParameterProvider } from './CommandLineParameterProvider';\nimport { CommandLineParserExitError } from './CommandLineParserExitError';\n\n/**\n * Options for the CommandLineAction constructor.\n * @public\n */\nexport interface ICommandLineActionOptions {\n /**\n * The name of the action. For example, if the tool is called \"example\",\n * then the \"build\" action might be invoked as: \"example build -q --some-other-option\"\n */\n actionName: string;\n\n /**\n * A quick summary that is shown on the main help page, which is displayed\n * by the command \"example --help\"\n */\n summary: string;\n\n /**\n * A detailed description that is shown on the action help page, which is displayed\n * by the command \"example build --help\", e.g. for actionName=\"build\".\n */\n documentation: string;\n}\n\n/**\n * Example: \"do-something\"\n */\nconst ACTION_NAME_REGEXP: RegExp = /^[a-z][a-z0-9]*([-:][a-z0-9]+)*$/;\n\n/**\n * Represents a sub-command that is part of the CommandLineParser command line.\n * Applications should create subclasses of CommandLineAction corresponding to\n * each action that they want to expose.\n *\n * The action name should be comprised of lower case words separated by hyphens\n * or colons. The name should include an English verb (e.g. \"deploy\"). Use a\n * hyphen to separate words (e.g. \"upload-docs\"). A group of related commands\n * can be prefixed with a colon (e.g. \"docs:generate\", \"docs:deploy\",\n * \"docs:serve\", etc).\n *\n * @public\n */\nexport abstract class CommandLineAction extends CommandLineParameterProvider {\n /** {@inheritDoc ICommandLineActionOptions.actionName} */\n public readonly actionName: string;\n\n /** {@inheritDoc ICommandLineActionOptions.summary} */\n public readonly summary: string;\n\n /** {@inheritDoc ICommandLineActionOptions.documentation} */\n public readonly documentation: string;\n\n private _argumentParser: argparse.ArgumentParser | undefined;\n\n public constructor(options: ICommandLineActionOptions) {\n super();\n\n if (!ACTION_NAME_REGEXP.test(options.actionName)) {\n throw new Error(\n `Invalid action name \"${options.actionName}\". ` +\n `The name must be comprised of lower-case words optionally separated by hyphens or colons.`\n );\n }\n\n this.actionName = options.actionName;\n this.summary = options.summary;\n this.documentation = options.documentation;\n\n this._argumentParser = undefined;\n }\n\n /**\n * This is called internally by CommandLineParser.addAction()\n * @internal\n */\n public _buildParser(actionsSubParser: argparse.SubParser): void {\n this._argumentParser = actionsSubParser.addParser(this.actionName, {\n help: this.summary,\n description: this.documentation\n });\n\n // Monkey-patch the error handling for the action parser\n this._argumentParser.exit = (status: number, message: string) => {\n throw new CommandLineParserExitError(status, message);\n };\n const originalArgumentParserErrorFn: (err: Error | string) => void = this._argumentParser.error.bind(\n this._argumentParser\n );\n this._argumentParser.error = (err: Error | string) => {\n // Ensure the ParserExitError bubbles up to the top without any special processing\n if (err instanceof CommandLineParserExitError) {\n throw err;\n }\n originalArgumentParserErrorFn(err);\n };\n\n this.onDefineParameters?.();\n }\n\n /**\n * Invoked by CommandLineParser.onExecute().\n * @internal\n */\n public _execute(): Promise<void> {\n return this.onExecute();\n }\n\n /**\n * {@inheritDoc CommandLineParameterProvider._getArgumentParser}\n * @internal\n */\n public _getArgumentParser(): argparse.ArgumentParser {\n // override\n if (!this._argumentParser) {\n // We will improve this in the future\n throw new Error('The CommandLineAction must be added to a CommandLineParser before it can be used');\n }\n\n return this._argumentParser;\n }\n\n /**\n * Your subclass should implement this hook to perform the operation.\n */\n protected abstract onExecute(): Promise<void>;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { type CommandLineParameter } from '../parameters/BaseClasses';
|
|
4
|
+
import { type CommandLineParameterBase, type CommandLineParameter } from '../parameters/BaseClasses';
|
|
5
5
|
import { CommandLineChoiceParameter, type IRequiredCommandLineChoiceParameter } from '../parameters/CommandLineChoiceParameter';
|
|
6
6
|
import { CommandLineChoiceListParameter } from '../parameters/CommandLineChoiceListParameter';
|
|
7
7
|
import { CommandLineIntegerParameter, type IRequiredCommandLineIntegerParameter } from '../parameters/CommandLineIntegerParameter';
|
|
@@ -73,7 +73,7 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
73
73
|
/**
|
|
74
74
|
* Returns a collection of the parameters that were defined for this object.
|
|
75
75
|
*/
|
|
76
|
-
get parameters(): ReadonlyArray<
|
|
76
|
+
get parameters(): ReadonlyArray<CommandLineParameterBase>;
|
|
77
77
|
/**
|
|
78
78
|
* Informs the caller if the argparse data has been processed into parameters.
|
|
79
79
|
*/
|
|
@@ -95,6 +95,7 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
95
95
|
*/
|
|
96
96
|
defineChoiceParameter<TChoice extends string = string>(definition: ICommandLineChoiceDefinition<TChoice> & {
|
|
97
97
|
required: false | undefined;
|
|
98
|
+
defaultValue: undefined;
|
|
98
99
|
}): CommandLineChoiceParameter<TChoice>;
|
|
99
100
|
/**
|
|
100
101
|
* {@inheritdoc CommandLineParameterProvider.(defineChoiceParameter:1)}
|
|
@@ -102,6 +103,12 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
102
103
|
defineChoiceParameter<TChoice extends string = string>(definition: ICommandLineChoiceDefinition<TChoice> & {
|
|
103
104
|
required: true;
|
|
104
105
|
}): IRequiredCommandLineChoiceParameter<TChoice>;
|
|
106
|
+
/**
|
|
107
|
+
* {@inheritdoc CommandLineParameterProvider.(defineChoiceParameter:1)}
|
|
108
|
+
*/
|
|
109
|
+
defineChoiceParameter<TChoice extends string = string>(definition: ICommandLineChoiceDefinition<TChoice> & {
|
|
110
|
+
defaultValue: TChoice;
|
|
111
|
+
}): IRequiredCommandLineChoiceParameter<TChoice>;
|
|
105
112
|
/**
|
|
106
113
|
* {@inheritdoc CommandLineParameterProvider.(defineChoiceParameter:1)}
|
|
107
114
|
*/
|
|
@@ -158,6 +165,7 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
158
165
|
*/
|
|
159
166
|
defineIntegerParameter(definition: ICommandLineIntegerDefinition & {
|
|
160
167
|
required: false | undefined;
|
|
168
|
+
defaultValue: undefined;
|
|
161
169
|
}): CommandLineIntegerParameter;
|
|
162
170
|
/**
|
|
163
171
|
* {@inheritdoc CommandLineParameterProvider.(defineIntegerParameter:1)}
|
|
@@ -165,6 +173,12 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
165
173
|
defineIntegerParameter(definition: ICommandLineIntegerDefinition & {
|
|
166
174
|
required: true;
|
|
167
175
|
}): IRequiredCommandLineIntegerParameter;
|
|
176
|
+
/**
|
|
177
|
+
* {@inheritdoc CommandLineParameterProvider.(defineIntegerParameter:1)}
|
|
178
|
+
*/
|
|
179
|
+
defineIntegerParameter(definition: ICommandLineIntegerDefinition & {
|
|
180
|
+
defaultValue: number;
|
|
181
|
+
}): IRequiredCommandLineIntegerParameter;
|
|
168
182
|
/**
|
|
169
183
|
* {@inheritdoc CommandLineParameterProvider.(defineIntegerParameter:1)}
|
|
170
184
|
*/
|
|
@@ -203,6 +217,7 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
203
217
|
*/
|
|
204
218
|
defineStringParameter(definition: ICommandLineStringDefinition & {
|
|
205
219
|
required: false | undefined;
|
|
220
|
+
defaultValue: undefined;
|
|
206
221
|
}): CommandLineStringParameter;
|
|
207
222
|
/**
|
|
208
223
|
* {@inheritdoc CommandLineParameterProvider.(defineStringParameter:1)}
|
|
@@ -210,6 +225,12 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
210
225
|
defineStringParameter(definition: ICommandLineStringDefinition & {
|
|
211
226
|
required: true;
|
|
212
227
|
}): IRequiredCommandLineStringParameter;
|
|
228
|
+
/**
|
|
229
|
+
* {@inheritdoc CommandLineParameterProvider.(defineStringParameter:1)}
|
|
230
|
+
*/
|
|
231
|
+
defineStringParameter(definition: ICommandLineStringDefinition & {
|
|
232
|
+
defaultValue: string;
|
|
233
|
+
}): IRequiredCommandLineStringParameter;
|
|
213
234
|
/**
|
|
214
235
|
* {@inheritdoc CommandLineParameterProvider.(defineStringParameter:1)}
|
|
215
236
|
*/
|
|
@@ -283,8 +304,21 @@ export declare abstract class CommandLineParameterProvider {
|
|
|
283
304
|
* @internal
|
|
284
305
|
*/
|
|
285
306
|
protected abstract _getArgumentParser(): argparse.ArgumentParser;
|
|
286
|
-
/**
|
|
287
|
-
|
|
307
|
+
/**
|
|
308
|
+
* This is called internally by {@link CommandLineParser.execute}
|
|
309
|
+
* @internal
|
|
310
|
+
*/
|
|
311
|
+
_preParse(): void;
|
|
312
|
+
/**
|
|
313
|
+
* This is called internally by {@link CommandLineParser.execute} before `printUsage` is called
|
|
314
|
+
* @internal
|
|
315
|
+
*/
|
|
316
|
+
_postParse(): void;
|
|
317
|
+
/**
|
|
318
|
+
* This is called internally by {@link CommandLineParser.execute}
|
|
319
|
+
* @internal
|
|
320
|
+
*/
|
|
321
|
+
_processParsedData(parserOptions: ICommandLineParserOptions, data: ICommandLineParserData): void;
|
|
288
322
|
/** @internal */
|
|
289
323
|
protected _defineParameter(parameter: CommandLineParameter): void;
|
|
290
324
|
/** @internal */
|
|
@@ -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,
|
|
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,wBAAwB,EAG7B,KAAK,oBAAoB,EAC1B,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,KAAK,mCAAmC,EACzC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAI1E;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,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