diff options
| author | Jacob Meacham <[email protected]> | 2015-01-29 00:06:09 -0800 |
|---|---|---|
| committer | Jacob Meacham <[email protected]> | 2015-01-29 00:06:09 -0800 |
| commit | 6d2e7203351b34dd53eed0dee796d93e0e10d4e7 (patch) | |
| tree | d08d62e99762259adc06233a03b5cdac8cba169d /lib/getOptions.js | |
| parent | 0718a261753046451c204be5f0abb31603a8dd19 (diff) | |
| download | node-coveralls-6d2e7203351b34dd53eed0dee796d93e0e10d4e7.tar.xz node-coveralls-6d2e7203351b34dd53eed0dee796d93e0e10d4e7.zip | |
allow users to pass options through.
Diffstat (limited to 'lib/getOptions.js')
| -rw-r--r-- | lib/getOptions.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/getOptions.js b/lib/getOptions.js index eab67f4..9713f03 100644 --- a/lib/getOptions.js +++ b/lib/getOptions.js @@ -108,11 +108,13 @@ var getBaseOptions = function(cb){ } }; -var getOptions = function(cb){ +var getOptions = function(cb, _userOptions){ if (!cb){ throw new Error('getOptions requires a callback'); } + var userOptions = _userOptions || {}; + getBaseOptions(function(err, options){ // try to get filepath from the command-line if (process.argv[2]) { @@ -124,7 +126,12 @@ var getOptions = function(cb){ options.filepath = process.argv[2]; } } - cb(err, options); + + // lodash or else would be better, but no need for the extra dependency + for (var option in userOptions) { + options[option] = userOptions[option]; + } + cb(err, options); }); }; |
