aboutsummaryrefslogtreecommitdiff
path: root/node_modules/yargs-parser/README.md
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-10 21:51:33 +0100
commit0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch)
treef9864d4a4148621378958794cbbfdc2393733283 /node_modules/yargs-parser/README.md
parent6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff)
upgrade dependencies
Diffstat (limited to 'node_modules/yargs-parser/README.md')
-rw-r--r--node_modules/yargs-parser/README.md45
1 files changed, 44 insertions, 1 deletions
diff --git a/node_modules/yargs-parser/README.md b/node_modules/yargs-parser/README.md
index 6d5916c33..a368e632b 100644
--- a/node_modules/yargs-parser/README.md
+++ b/node_modules/yargs-parser/README.md
@@ -11,7 +11,7 @@ The mighty option parser used by [yargs](https://github.com/yargs/yargs).
visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions.
-<img width="250" src="https://github.com/yargs/yargs-parser/blob/master/yargs-logo.png">
+<img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/master/yargs-logo.png">
## Example
@@ -72,12 +72,14 @@ Parses command line arguments returning a simple mapping of keys and values.
* `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`).
* `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)).
* `opts.number`: keys should be treated as numbers.
+ * `opts['--']`: arguments after the end-of-options flag `--` will be set to the `argv.['--']` array instead of being set to the `argv._` array.
**returns:**
* `obj`: an object representing the parsed value of `args`
* `key/value`: key value pairs for each argument and their aliases.
* `_`: an array representing the positional arguments.
+ * [optional] `--`: an array with arguments after the end-of-options flag `--`.
### require('yargs-parser').detailed(args, opts={})
@@ -100,6 +102,7 @@ yargs engine.
* `configuration`: the configuration loaded from the `yargs` stanza in package.json.
<a name="configuration"></a>
+
### Configuration
The yargs-parser applies several automated transformations on the keys provided
@@ -247,6 +250,46 @@ node example.js -x 1 2 -x 3 4
{ _: [], x: [[1, 2], [3, 4]] }
```
+### negation prefix
+
+* default: `no-`
+* key: `negation-prefix`
+
+The prefix to use for negated boolean variables.
+
+```sh
+node example.js --no-foo
+{ _: [], foo: false }
+```
+
+_if set to `quux`:_
+
+```sh
+node example.js --quuxfoo
+{ _: [], foo: false }
+```
+
+### populate --
+
+* default: `false`.
+* key: `populate--`
+
+Should unparsed flags be stored in `--` or `_`.
+
+_If disabled:_
+
+```sh
+node example.js a -b -- x y
+{ _: [ 'a', 'x', 'y' ], b: true }
+```
+
+_If enabled:_
+
+```sh
+node example.js a -b -- x y
+{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true }
+```
+
## Special Thanks
The yargs project evolves from optimist and minimist. It owes its