diff --git a/lib/nconf/provider.js b/lib/nconf/provider.js index b58c7820..c214ba6d 100644 --- a/lib/nconf/provider.js +++ b/lib/nconf/provider.js @@ -6,7 +6,6 @@ */ var async = require('async'), - optimist = require('optimist'), common = require('./common'), stores = require('./stores'); @@ -236,7 +235,11 @@ Provider.prototype.__defineGetter__('useArgv', function () { // Provider.prototype.__defineSetter__('useArgv', function (val) { this._useArgv = val || false; - this.overrides = this.overrides || optimist.argv; + + if (this._useArgv) { + this._argv = this._argv || require('optimist').argv; + this.overrides = this.overrides || this._argv; + } }); //