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.
master
Ethan Winn 2012-08-07 01:52:29 -04:00
parent 7279bc11b3
commit 0f092ab5a4
1 changed files with 26 additions and 19 deletions

View File

@ -157,13 +157,20 @@ A simple in-memory storage engine that stores a nested JSON representation of th
```
### 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
//
// 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