From 1b258bf5b313844f40b7f84a683e2bb8e4f168e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82ecki?= Date: Tue, 22 Nov 2011 02:06:09 +0100 Subject: [PATCH] [fix] Fix option parsing See nodejitsu/forever#165. --- lib/nconf/stores/system.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/nconf/stores/system.js b/lib/nconf/stores/system.js index 57fd848..c55c128 100644 --- a/lib/nconf/stores/system.js +++ b/lib/nconf/stores/system.js @@ -7,7 +7,6 @@ */ var util = require('util'), - optimist = require('optimist'), Memory = require('./memory').Memory; // @@ -78,12 +77,12 @@ System.prototype.loadOverrides = function () { System.prototype.loadArgv = function () { var self = this, argv; - + if (typeof this.argv === 'object') { - argv = optimist(process.argv.slice(2)).options(this.argv).argv; + argv = require('optimist')(process.argv.slice(2)).options(this.argv).argv; } else if (this.argv) { - argv = optimist(process.argv.slice(2)).argv; + argv = require('optimist')(process.argv.slice(2)).argv; } if (!argv) {