Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Returns configuration settings object.

- `[options]` {Object}
- `[dirname]` Root directory of your app package. Required to find `package.json` and package settings file.
- `[cli]` {Object} Command line interface parsing options. Refer to [minimist](https://github.com/substack/minimist) documentation.
- `[cli]` {Object} Command line interface parsing options. Refer to [minimist](https://github.com/substack/minimist) documentation. Define as empty object to use default values.
- `[clone]` {Boolean} If `true`, copies package settings file to users home directory. (default: `false`).
- `[merge]` {String} Merge attributes using `'shallow'` or `'deep'` recursive merging (default: `'shallow'`).
- `[configFile]` {String} Settings file name. (default: `.<appname>.json`).
Expand Down Expand Up @@ -244,4 +244,4 @@ Loads configuration settings and executes a command function from the command tr
} catch (err) {
console.error(err);
process.exit(1);
}
}
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ module.exports = {
}

// Parse and Merge command line options:
var cli_cfg = require('minimist')(process.argv.slice(2), options.cli || {});
if(options.cli) {
var cli_cfg = require('minimist')(process.argv.slice(2), options.cli);
}

if (cli_cfg) {
validator2('command line args', cli_cfg, false);
cfg = fnMerge(cfg, cli_cfg);
Expand Down