Added docs for options hash to optimist.
I had to dig a bit to figure out how to get options working on argv, thought I'd save others the time.
This commit is contained in:
parent
7279bc11b3
commit
0f092ab5a4
1 changed files with 26 additions and 19 deletions
11
README.md
11
README.md
|
@ -157,13 +157,20 @@ A simple in-memory storage engine that stores a nested JSON representation of th
|
||||||
```
|
```
|
||||||
|
|
||||||
### Argv
|
### Argv
|
||||||
Responsible for loading the values parsed from `process.argv` by `optimist` into the configuration hierarchy.
|
Responsible for loading the values parsed from `process.argv` by `optimist` into the configuration hierarchy. See the [optimist option docs](https://github.com/substack/node-optimist/#optionskey-opt) for more on the option format.
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
//
|
//
|
||||||
// Can optionally also be an object literal to pass to `optimist`.
|
// Can optionally also be an object literal to pass to `optimist`.
|
||||||
//
|
//
|
||||||
nconf.argv(options);
|
nconf.argv({
|
||||||
|
"x": {
|
||||||
|
alias: 'example',
|
||||||
|
describe: 'Example description for usage generation',
|
||||||
|
demand: true,
|
||||||
|
default: 'some-value'
|
||||||
|
}
|
||||||
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### Env
|
### Env
|
||||||
|
|
Loading…
Reference in a new issue