[fix] Lazy-load any CLI arguments from `optimist`

master
indexzero 2011-08-29 15:19:55 -04:00
parent 8a3172868e
commit e631d239d5
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}
});
//