[fix] Fix option parsing

See nodejitsu/forever#165.
This commit is contained in:
Maciej Małecki 2011-11-22 02:06:09 +01:00
parent ef3222e7ab
commit 1b258bf5b3

View file

@ -7,7 +7,6 @@
*/ */
var util = require('util'), var util = require('util'),
optimist = require('optimist'),
Memory = require('./memory').Memory; Memory = require('./memory').Memory;
// //
@ -78,12 +77,12 @@ System.prototype.loadOverrides = function () {
System.prototype.loadArgv = function () { System.prototype.loadArgv = function () {
var self = this, var self = this,
argv; argv;
if (typeof this.argv === 'object') { 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) { else if (this.argv) {
argv = optimist(process.argv.slice(2)).argv; argv = require('optimist')(process.argv.slice(2)).argv;
} }
if (!argv) { if (!argv) {