utils/node_modules/@rushstack/ts-command-line/lib/parameters/CommandLineDefinition.js.map

1 line
8.7 KiB
Plaintext
Raw Normal View History

2024-02-07 01:33:07 -05:00
{"version":3,"file":"CommandLineDefinition.js","sourceRoot":"","sources":["../../src/parameters/CommandLineDefinition.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { SCOPING_PARAMETER_GROUP } from '../Constants';\n\n/**\n * For use with CommandLineParser, this interface represents a generic command-line parameter\n *\n * @public\n */\nexport interface IBaseCommandLineDefinition {\n /**\n * The long name of the flag including double dashes, e.g. \"--do-something\"\n */\n parameterLongName: string;\n\n /**\n * An optional short name for the flag including the dash, e.g. \"-d\"\n */\n parameterShortName?: string;\n\n /**\n * An optional parameter group name, shown when invoking the tool with \"--help\"\n */\n parameterGroup?: string | typeof SCOPING_PARAMETER_GROUP;\n\n /**\n * An optional parameter scope name, used to add a scope-prefixed parameter synonym,\n * e.g. \"--scope:do-something\". Scopes provide additional flexibility for parameters\n * in conflict resolution since when a scope is specified, parameters that have\n * conflicting long names will be defined using only the scope-prefixed name.\n */\n parameterScope?: string;\n\n /**\n * Documentation for the parameter that will be shown when invoking the tool with \"--help\"\n */\n description: string;\n\n /**\n * If true, then an error occurs if the parameter was not included on the command-line.\n */\n required?: boolean;\n\n /**\n * The name of an environment variable that the parameter value will be read from,\n * if it was omitted from the command-line. An error will be reported if the\n * environment value cannot be parsed.\n *\n * @remarks\n * The environment variable name must consist only of upper-case letters, numbers,\n * and underscores. It may not start with a number.\n *\n * This feature cannot be used when {@link IBaseCommandLineDefinition.required} is true,\n * because in that case the environmentVariable would never be used.\n *\n * Syntax notes for environment variable values:\n *\n * - Choice Parameter: The value must match one of the defined choices,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - Flag Parameter: The value must be `1` for true, or `0` for false,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - Integer Parameter: The value must be an integer number,\n * otherwise a validation error is reported.\n * An empty string causes the environment variable to be ignored.\n *\n * - String Parameter: Any value is accepted, including an empty string.\n *\n * - String List Parameter: If the string starts with `[` (ignoring whitespace)\n * then it will be parsed as a JSON array, whose elements must be strings,\n * numbers, or boolean values.\n * If the string does not start with `[`, then it behaves like an\n * ordinary String Parameter: Any value is accepted, including an empty string.\n */\n environmentVariable?: string;\n\n /**\n * Specifies additional names for this parameter that are accepted but not displayed\n * in the command line help.\n *\n * @remarks\n * This option can be used in cases where a command-line parameter may have been renamed,\n * but the developer doesn't want to break backwards compatibility with systems that may\n * still be using the old name. Only the `parameterLongName` syntax is currently allowed.\n */\n undocumentedSynonyms?: string[];\n}\n\n/**\n * The common base interface for parameter types that accept an argument.\n *\n * @remarks\n * An argument is an accompanying command-line token, such as \"123\" in the\n * example \"--max-count 123\".\n * @public\n */\nexport interface IBaseCommandLineDefinitionWithArgument extends IB