fix: a
This commit is contained in:
16
node_modules/commander/lib/argument.js
generated
vendored
16
node_modules/commander/lib/argument.js
generated
vendored
@@ -50,7 +50,7 @@ class Argument {
|
||||
}
|
||||
|
||||
/**
|
||||
* @api private
|
||||
* @package
|
||||
*/
|
||||
|
||||
_concatValue(value, previous) {
|
||||
@@ -98,7 +98,9 @@ class Argument {
|
||||
this.argChoices = values.slice();
|
||||
this.parseArg = (arg, previous) => {
|
||||
if (!this.argChoices.includes(arg)) {
|
||||
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);
|
||||
throw new InvalidArgumentError(
|
||||
`Allowed choices are ${this.argChoices.join(', ')}.`,
|
||||
);
|
||||
}
|
||||
if (this.variadic) {
|
||||
return this._concatValue(arg, previous);
|
||||
@@ -110,6 +112,8 @@ class Argument {
|
||||
|
||||
/**
|
||||
* Make argument required.
|
||||
*
|
||||
* @returns {Argument}
|
||||
*/
|
||||
argRequired() {
|
||||
this.required = true;
|
||||
@@ -118,6 +122,8 @@ class Argument {
|
||||
|
||||
/**
|
||||
* Make argument optional.
|
||||
*
|
||||
* @returns {Argument}
|
||||
*/
|
||||
argOptional() {
|
||||
this.required = false;
|
||||
@@ -130,15 +136,13 @@ class Argument {
|
||||
*
|
||||
* @param {Argument} arg
|
||||
* @return {string}
|
||||
* @api private
|
||||
* @private
|
||||
*/
|
||||
|
||||
function humanReadableArgName(arg) {
|
||||
const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');
|
||||
|
||||
return arg.required
|
||||
? '<' + nameOutput + '>'
|
||||
: '[' + nameOutput + ']';
|
||||
return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';
|
||||
}
|
||||
|
||||
exports.Argument = Argument;
|
||||
|
||||
Reference in New Issue
Block a user