All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
16.1.0 (2020-06-26)
- drops Node 6. begin following Node.js LTS schedule (#278)
- the narg count is now enforced when parsing arrays.
- this reverts parsing behavior of booleans to that of yargs@14
- objects used during parsing are now created with a null
- populate error if incompatible narg/count or array/count options are used (#191)
- moving to c8 for coverage and dropping Node 6 from build matrix (#209)
- rework
collect-unknown-options
intounknown-options-as-args
, providing more comprehensive functionality - unless "parse-numbers" is set to "false", arrays of numeric strings are now parsed as numbers, rather than strings.
- we have dropped the broken "defaulted" functionality; we would like to revisit adding this in the future.
- maybeCoerceNumber now takes precedence over coerce return value (#182)
- options with leading '+' or '0' now parse as strings
- a flag with no right-hand value no longer populates defaulted options with
undefined
. - quotes and beginning and endings of strings are not removed during parsing.
- drops Node 4 support
- the argv object is now populated differently (correctly) when hyphens and dot notation are used in conjunction.
boolean
flags defined without adefault
value will now behave like other option type and won't be set in the parsed results when the user doesn't set the corresponding CLI arg.- arguments of form --foo, -abc, will no longer be consumed by nargs
- strings that fail
Number.isSafeInteger()
are no longer coerced into numbers.
- deps: update to latest camelcase/decamelize (#281) (8931ab0)
- add
set-placeholder-key
configuration (#123) (19386ee) - add
strip-aliased
andstrip-dashed
configuration options. (#172) (a3936aa) - add configuration option to "collect-unknown-options" (#181) (7909cc4)
- add halt-at-non-option configuration option (#130) (a849fce)
- allow configuration of prefix for boolean negation (#94) (00bde7d)
- also add camelCase array options (#125) (08c0117)
- array.type can now be provided, supporting coercion (#132) (4b8cfce)
- boolean arguments will not be collected into an implicit array (#236) (34c4e19)
- default value is now used if no right-hand value provided for numbers/strings (#156) (5a7c46a)
- don't coerce number from string with leading '0' or '+' (#158) (18d0fd5)
- introduce greedy-arrays config, for specifying whether arrays consume multiple positionals (#249) (60e880a)
- introduce nargs-eats-options config option (#246) (d50822a)
- introduce single-digit boolean aliases (#255) (9c60265)
- make combining arrays a configurable option (#111) (c8bf536)
- maybeCoerceNumber() now takes into account arrays (#187) (31c204b)
- merge array from arguments with array from config (#83) (806ddd6)
- NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array (#251) (9db4be8)
- narg arguments no longer consume flag arguments (#114) (60bb9b3)
- options that have had their default value used are now tracked (#211) (a525234)
- populate error if incompatible narg/count or array/count options are used (#191) (84a401f)
- rework
collect-unknown-options
intounknown-options-as-args
, providing more comprehensive functionality (ef771ca) - reworking how numbers are parsed (#104) (fba00eb)
- support boolean which do not consume next argument. (#171) (0ae7fcb)
- array, nargs: support -o=--value and --option=--value format (#262) (41d3f81)
- deps: update dependency decamelize to v3 (#274) (4d98698)
- setArg: options using camel-case and dot-notation populated twice (#268) (f7e15b9)
- proto will now be replaced with proto in parse (#258) (63810ca)
- address bugs with "uknown-options-as-args" (bc023e3)
- address issue with array options with array default values (#206) (f5f9e5a)
- allow null config values (#108) (d8b14f9)
- array should take precedence over nargs, but enforce nargs (#243) (4cbc188)
- better handling of quoted strings (#153) (2fb71b2)
- boolean arrays with default values (#185) (7d42572)
- boolean now behaves the same as other array types (#184) (17ca3bd)
- convert values to strings when tokenizing (#167) (57b7883)
- do not set boolean flags if not defined in
argv
(#119) (f6e6599) - eatNargs() for 'opt.narg === 0' and boolean typed options (#188) (c5a1db0)
- ensure consistent parsing of dot-notation arguments (#102) (c9bd79c)
- ensure empty string is added into argv._ (#140) (79cda98)
- flatten-duplicate-arrays:false for more than 2 arrays (#128) (2bc395f)
- handling of one char alias (#139) (ee56e31)
- hyphenated flags combined with dot notation broke parsing (#131) (dc788da)
- Ignore multiple spaces between arguments. (#100) (d137227)
- implement @antoniom's fix for camel-case expansion (3087e1d)
- make requiresArg work in conjunction with arrays (#136) (77ae1d4)
- maybeCoerceNumber now takes precedence over coerce return value (#182) (2f26436)
- nargs should allow duplicates when duplicate-arguments-array=false (#164) (47ccb0b)
- nargs was consuming too many arguments (4fef206)
- nargs was still aggressively consuming too many arguments (9b28aad)
- normalized keys were not enumerable (#247) (57119f9)
- only run coercion functions once, despite aliases. (#76) (#103) (507aaef)
- scientific notation circumvented bounds check (#110) (3571f57)
- should populate "_" when given config with "short-option-groups" false (#179) (6055974)
- support keys that collide with object prototypes (#234) (1587b6d)
- support negative numbers with decimal places (#208) (850bbda)
- unknown options terminated with digits now handled by unknown-options-as-args (#238) (d36cdfa)
- unknown-options-as-args: '--' is not an unknown option (#207) (3fee2d8)
- take into account aliases when appending arrays from config object (#199) (f8a2d3f)
- tokenizer should ignore spaces at the beginning of the argString (#106) (f34ead9)
- make requiresArg work in conjunction with arrays (#136) (f4a3063)
- revert 16.0.0 CHANGELOG entry (920320a)
- update dependencies (6dc42a1)
- drops Node 6. begin following Node.js LTS schedule (#278) (9014ed7)
- moving to c8 for coverage and dropping Node 6 from build matrix (#209) (f3a9316)
18.1.3 (2020-04-16)
18.1.2 (2020-03-26)
18.1.1 (2020-03-16)
- __proto__ will now be replaced with ___proto___ in parse (#258), patching a potential prototype pollution vulnerability. This was reported by the Snyk Security Research Team.(63810ca)
18.1.0 (2020-03-07)
18.0.0 (2020-03-02)
- the narg count is now enforced when parsing arrays.
- NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array (#251) (9db4be8)
17.1.0 (2020-03-01)
- introduce greedy-arrays config, for specifying whether arrays consume multiple positionals (#249) (60e880a)
17.0.1 (2020-02-29)
17.0.0 (2020-02-10)
- this reverts parsing behavior of booleans to that of yargs@14
- objects used during parsing are now created with a null prototype. There may be some scenarios where this change in behavior leaks externally.
- boolean arguments will not be collected into an implicit array (#236) (34c4e19)
- introduce nargs-eats-options config option (#246) (d50822a)
- address bugs with "uknown-options-as-args" (bc023e3)
- array should take precedence over nargs, but enforce nargs (#243) (4cbc188)
- support keys that collide with object prototypes (#234) (1587b6d)
- unknown options terminated with digits now handled by unknown-options-as-args (#238) (d36cdfa)
16.1.0 (2019-11-01)
- populate error if incompatible narg/count or array/count options are used (#191)
- options that have had their default value used are now tracked (#211) (a525234)
- populate error if incompatible narg/count or array/count options are used (#191) (84a401f)
- revert 16.0.0 CHANGELOG entry (920320a)
15.0.0 (2019-10-07)
- rework
collect-unknown-options
intounknown-options-as-args
, providing more comprehensive functionality (ef771ca)
- rework
collect-unknown-options
intounknown-options-as-args
, providing more comprehensive functionality
14.0.0 (2019-09-06)
- boolean arrays with default values (#185) (7d42572)
- boolean now behaves the same as other array types (#184) (17ca3bd)
- eatNargs() for 'opt.narg === 0' and boolean typed options (#188) (c5a1db0)
- maybeCoerceNumber now takes precedence over coerce return value (#182) (2f26436)
- take into account aliases when appending arrays from config object (#199) (f8a2d3f)
- add configuration option to "collect-unknown-options" (#181) (7909cc4)
- maybeCoerceNumber() now takes into account arrays (#187) (31c204b)
- unless "parse-numbers" is set to "false", arrays of numeric strings are now parsed as numbers, rather than strings.
- we have dropped the broken "defaulted" functionality; we would like to revisit adding this in the future.
- maybeCoerceNumber now takes precedence over coerce return value (#182)
13.1.1 (2019-06-10)
- convert values to strings when tokenizing (#167) (57b7883)
- nargs should allow duplicates when duplicate-arguments-array=false (#164) (47ccb0b)
- should populate "_" when given config with "short-option-groups" false (#179) (6055974)
13.1.0 (2019-05-05)
- add
strip-aliased
andstrip-dashed
configuration options. (#172) (a3936aa) - support boolean which do not consume next argument. (#171) (0ae7fcb)
13.0.0 (2019-02-02)
- options with leading '+' or '0' now parse as strings
12.0.0 (2019-01-29)
- a flag with no right-hand value no longer populates defaulted options with
undefined
. - quotes at beginning and endings of strings are not removed during parsing.
11.1.1 (2018-11-19)
11.1.0 (2018-11-10)
11.0.0 (2018-10-06)
- flatten-duplicate-arrays:false for more than 2 arrays (#128) (2bc395f)
- hyphenated flags combined with dot notation broke parsing (#131) (dc788da)
- make requiresArg work in conjunction with arrays (#136) (77ae1d4)
- update dependencies (6dc42a1)
- also add camelCase array options (#125) (08c0117)
- array.type can now be provided, supporting coercion (#132) (4b8cfce)
- drops Node 4 support
- the argv object is now populated differently (correctly) when hyphens and dot notation are used in conjunction.
10.1.0 (2018-06-29)
10.0.0 (2018-04-04)
boolean
flags defined without adefault
value will now behave like other option type and won't be set in the parsed results when the user doesn't set the corresponding CLI arg.
Previous behavior:
var parse = require('yargs-parser');
parse('--flag', {boolean: ['flag']});
// => { _: [], flag: true }
parse('--no-flag', {boolean: ['flag']});
// => { _: [], flag: false }
parse('', {boolean: ['flag']});
// => { _: [], flag: false }
New behavior:
var parse = require('yargs-parser');
parse('--flag', {boolean: ['flag']});
// => { _: [], flag: true }
parse('--no-flag', {boolean: ['flag']});
// => { _: [], flag: false }
parse('', {boolean: ['flag']});
// => { _: [] } => flag not set similarly to other option type
9.0.2 (2018-01-20)
- nargs was still aggressively consuming too many arguments (9b28aad)
9.0.1 (2018-01-20)
- nargs was consuming too many arguments (4fef206)
9.0.0 (2018-01-20)
- arguments of form --foo, -abc, will no longer be consumed by nargs
8.1.0 (2017-12-20)
- allow null config values (#108) (d8b14f9)
- ensure consistent parsing of dot-notation arguments (#102) (c9bd79c)
- implement @antoniom's fix for camel-case expansion (3087e1d)
- only run coercion functions once, despite aliases. (#76) (#103) (507aaef)
- scientific notation circumvented bounds check (#110) (3571f57)
- tokenizer should ignore spaces at the beginning of the argString (#106) (f34ead9)
- make combining arrays a configurable option (#111) (c8bf536)
- merge array from arguments with array from config (#83) (806ddd6)
8.0.0 (2017-10-05)
- allow configuration of prefix for boolean negation (#94) (00bde7d)
- reworking how numbers are parsed (#104) (fba00eb)
- strings that fail
Number.isSafeInteger()
are no longer coerced into numbers.
7.0.0 (2017-05-02)
- populate-- now defaults to false.
6.0.1 (2017-05-01)
6.0.0 (2017-05-01)
- environment variables should take precedence over config file (#81) (76cee1f)
- parsing hints should apply for dot notation keys (#86) (3e47d62)
- add -- option which allows arguments after the -- flag to be returned separated from positional arguments (#84) (2572ca8)
- when parsing stops, we now populate "--" by default (#88) (cd666db)
- rather than placing arguments in "_", when parsing is stopped via "--"; we now populate an array called "--" by default.
- camelcase now requires Node 4+.
- environment variables will now override config files (args, env, config-file, config-object)
5.0.0 (2017-02-18)
- environment variables will now override config files (args, env, config-file, config-object)
4.2.1 (2017-01-02)
4.2.0 (2016-12-01)
- inner objects in configs had their keys appended to top-level key when dot-notation was disabled (#72) (0b1b5f9)
4.1.0 (2016-11-07)
- apply coercions to default options (#65) (c79052b)
- handle dot notation boolean options (#63) (02c3545)
4.0.2 (2016-09-30)
- whoops, let's make the assign not change the Object key order (29d069a)
4.0.1 (2016-09-30)
4.0.0 (2016-09-26)
- coerce is no longer applied to individual arguments in an implicit array.
3.2.0 (2016-08-13)
3.1.0 (2016-08-09)
- address pkgConf parsing bug outlined in #37 (#45) (be76ee6)
- better parsing of negative values (#44) (2e43692)
- check aliases when guessing defaults for arguments fixes #41 (#43) (f3e4616)
3.0.0 (2016-08-07)
- parsing issue with numeric character in group of options (#19) (f743236)
- upgraded lodash.assign (5d7fdf4)
- subtle change to how values are parsed in a group of single-character arguments.
- first released in 3.1.0, better handling of negative values should be considered a breaking change.
2.4.1 (2016-07-16)
2.4.0 (2016-04-11)
2.3.0 (2016-04-09)
- boolean: fix for boolean options with non boolean defaults (#20) (2dbe86b), closes [(#20](https://github.com/(/issues/20)
- package: remove tests from tarball (0353c0d)
- parsing: handle calling short option with an empty string as the next value. (a867165)
- boolean flag when next value contains the strings 'true' or 'false'. (69941a6)
- update dependencies; add standard-version bin for next release (#24) (822d9d5)