From 2f1953c4ffecd2d322f7089ec0fe4cc661fab0b1 Mon Sep 17 00:00:00 2001 From: John Gee Date: Thu, 12 Oct 2023 19:05:59 +1300 Subject: [PATCH] readme: add description of --no Also, remove old security warning. Fixes: #38 --- README.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 74da323..e13fc17 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ $ node example/parse.js -a beep -b boop ``` ``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop --no-ding foo bar baz { _: ['foo', 'bar', 'baz'], x: 3, @@ -34,20 +34,11 @@ $ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz a: true, b: true, c: true, - beep: 'boop' + beep: 'boop', + ding: false } ``` -# security - -Previous versions had a prototype pollution bug that could cause privilege -escalation in some circumstances when handling untrusted user input. - -Please use version 1.2.6 or later: - -* https://security.snyk.io/vuln/SNYK-JS-MINIMIST-2429795 (version <=1.2.5) -* https://snyk.io/vuln/SNYK-JS-MINIMIST-559764 (version <=1.2.3) - # methods ``` js @@ -64,6 +55,8 @@ them. Numeric-looking arguments will be returned as numbers unless `opts.string` or `opts.boolean` is set for that argument name. +A negated argument of the form `--no-foo` returns `false` for option `foo`. + Any arguments after `'--'` will not be parsed and will end up in `argv._`. options can be: