Comparing version 15.3.0-beta.0 to 15.3.0-beta.1
@@ -276,3 +276,11 @@ 'use strict' | ||
if (groupName === self.getPositionalGroupName()) return sw | ||
else return (/^[^0-9]$/.test(sw) ? '-' : '--') + sw | ||
else { | ||
return ( | ||
// matches yargs-parser logic in which single-digits | ||
// aliases declared with a boolean type are now valid | ||
/^[0-9]$/.test(sw) | ||
? ~options.boolean.indexOf(key) ? '-' : '--' | ||
: sw.length > 1 ? '--' : '-' | ||
) + sw | ||
} | ||
}) | ||
@@ -504,2 +512,4 @@ .join(', ') | ||
const maxWidth = 80 | ||
// CI is not a TTY | ||
/* c8 ignore next 2 */ | ||
if (typeof process === 'object' && process.stdout && process.stdout.columns) { | ||
@@ -506,0 +516,0 @@ return Math.min(maxWidth, process.stdout.columns) |
{ | ||
"name": "yargs", | ||
"version": "15.3.0-beta.0", | ||
"version": "15.3.0-beta.1", | ||
"description": "yargs the modern, pirate-themed, successor to optimist.", | ||
@@ -32,3 +32,3 @@ "main": "./index.js", | ||
"y18n": "^4.0.0", | ||
"yargs-parser": "^18.0.0" | ||
"yargs-parser": "^18.1.0" | ||
}, | ||
@@ -39,3 +39,2 @@ "devDependencies": { | ||
"chalk": "^3.0.0", | ||
"coveralls": "^3.0.3", | ||
"cpr": "^3.0.1", | ||
@@ -55,3 +54,3 @@ "cross-spawn": "^7.0.0", | ||
"test": "c8 --reporter=html --reporter=text mocha --require ./test/before.js --timeout=12000 --check-leaks", | ||
"coverage": "c8 report --reporter=text-lcov | coveralls" | ||
"coverage": "c8 report --check-coverage check-coverage --lines=100 --branches=96 --statements=100" | ||
}, | ||
@@ -58,0 +57,0 @@ "repository": { |
@@ -12,3 +12,2 @@ <p align="center"> | ||
[![Build Status][travis-image]][travis-url] | ||
[![Coverage Status][coveralls-image]][coveralls-url] | ||
[![NPM version][npm-image]][npm-url] | ||
@@ -131,4 +130,2 @@ [![js-standard-style][standard-image]][standard-url] | ||
[travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg | ||
[coveralls-url]: https://coveralls.io/github/yargs/yargs | ||
[coveralls-image]: https://img.shields.io/coveralls/yargs/yargs.svg | ||
[npm-url]: https://www.npmjs.com/package/yargs | ||
@@ -135,0 +132,0 @@ [npm-image]: https://img.shields.io/npm/v/yargs.svg |
15
yargs.js
@@ -238,5 +238,14 @@ 'use strict' | ||
self.requiresArg = function (keys) { | ||
argsert('<array|string>', [keys], arguments.length) | ||
populateParserHintObject(self.nargs, false, 'narg', keys, NaN) | ||
self.requiresArg = function (keys, value) { | ||
argsert('<array|string|object> [number]', [keys], arguments.length) | ||
// If someone configures nargs at the same time as requiresArg, | ||
// nargs should take precedent, | ||
// see: https://github.com/yargs/yargs/pull/1572 | ||
// TODO: make this work with aliases, using a check similar to | ||
// checkAllAliases() in yargs-parser. | ||
if (typeof keys === 'string' && options.narg[keys]) { | ||
return self | ||
} else { | ||
populateParserHintObject(self.requiresArg, false, 'narg', keys, NaN) | ||
} | ||
return self | ||
@@ -243,0 +252,0 @@ } |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12
3920
180434
138
Updatedyargs-parser@^18.1.0