1 line
2.6 KiB
Plaintext
1 line
2.6 KiB
Plaintext
{"version":3,"file":"CommandLineRemainder.js","sourceRoot":"","sources":["../../src/parameters/CommandLineRemainder.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D;;;GAGG;AACH,MAAa,oBAAoB;IAM/B,gBAAgB;IAChB,YAAmB,UAA2C;QANtD,YAAO,GAAa,EAAE,CAAC;QAO7B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,8DAA8D;IACvD,SAAS,CAAC,IAAS;QACxB,WAAW;QACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,EAAE;YACrE,MAAM,IAAI,KAAK,CAAC,wCAAwC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;SAClF;QAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,mEAAmE;IAC5D,eAAe,CAAC,OAAiB;QACtC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;gBAC/B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACrB;SACF;IACH,CAAC;CACF;AA5CD,oDA4CC","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 { ICommandLineRemainderDefinition } from './CommandLineDefinition';\n\n/**\n * The data type returned by {@link CommandLineParameterProvider.defineCommandLineRemainder}.\n * @public\n */\nexport class CommandLineRemainder {\n private _values: string[] = [];\n\n /** {@inheritDoc IBaseCommandLineDefinition.description} */\n public readonly description: string;\n\n /** @internal */\n public constructor(definition: ICommandLineRemainderDefinition) {\n this.description = definition.description;\n }\n\n /**\n * Returns any remaining command line arguments after the recognized portion\n * that was parsed from the command line.\n *\n * @remarks\n * The array will be empty if the command-line has not been parsed yet.\n */\n public get values(): ReadonlyArray<string> {\n return this._values;\n }\n\n /**\n * {@inheritDoc CommandLineParameter._setValue}\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public _setValue(data: any): void {\n // abstract\n if (!Array.isArray(data) || !data.every((x) => typeof x === 'string')) {\n throw new Error(`Unexpected data object for remainder: ` + JSON.stringify(data));\n }\n\n this._values.push(...data);\n }\n\n /** {@inheritDoc CommandLineParameter.appendToArgList} @override */\n public appendToArgList(argList: string[]): void {\n if (this.values.length > 0) {\n for (const value of this.values) {\n argList.push(value);\n }\n }\n }\n}\n"]} |