Skip to content

Commit

Permalink
[fix] Lazy-load any CLI arguments from optimist
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Aug 29, 2011
1 parent 8a31728 commit e631d23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/nconf/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

var async = require('async'),
optimist = require('optimist'),
common = require('./common'),
stores = require('./stores');

Expand Down Expand Up @@ -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;
}
});

//
Expand Down

0 comments on commit e631d23

Please sign in to comment.