yargs-parser
Advanced tools
Comparing version 17.0.1 to 17.1.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01) | ||
### Features | ||
* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb)) | ||
### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29) | ||
@@ -7,0 +14,0 @@ |
18
index.js
@@ -16,18 +16,19 @@ const camelCase = require('camelcase') | ||
const configuration = Object.assign({ | ||
'short-option-groups': true, | ||
'boolean-negation': true, | ||
'camel-case-expansion': true, | ||
'combine-arrays': false, | ||
'dot-notation': true, | ||
'parse-numbers': true, | ||
'boolean-negation': true, | ||
'negation-prefix': 'no-', | ||
'duplicate-arguments-array': true, | ||
'flatten-duplicate-arrays': true, | ||
'greedy-arrays': true, | ||
'halt-at-non-option': false, | ||
'nargs-eats-options': false, | ||
'negation-prefix': 'no-', | ||
'parse-numbers': true, | ||
'populate--': false, | ||
'combine-arrays': false, | ||
'set-placeholder-key': false, | ||
'halt-at-non-option': false, | ||
'short-option-groups': true, | ||
'strip-aliased': false, | ||
'strip-dashed': false, | ||
'unknown-options-as-args': false, | ||
'nargs-eats-options': false | ||
'unknown-options-as-args': false | ||
}, opts.configuration) | ||
@@ -416,2 +417,3 @@ const defaults = Object.assign(Object.create(null), opts.default) | ||
argsToSet.push(processValue(key, next)) | ||
if (!configuration['greedy-arrays']) break | ||
} | ||
@@ -418,0 +420,0 @@ } |
{ | ||
"name": "yargs-parser", | ||
"version": "17.0.1", | ||
"version": "17.1.0", | ||
"description": "the mighty option parser used by yargs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -268,2 +268,23 @@ # yargs-parser | ||
### greedy arrays | ||
* default: `true` | ||
* key: `greedy-arrays` | ||
Should arrays consume more than one positional argument following their flag. | ||
```sh | ||
node example --arr 1 2 | ||
{ _[], arr: [1, 2] } | ||
``` | ||
_if disabled:_ | ||
```sh | ||
node example --arr 1 2 | ||
{ _[2], arr: [1] } | ||
``` | ||
**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.** | ||
### nargs eats options | ||
@@ -270,0 +291,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
67949
902
451
1