Permalink
Browse files

fix repl optional port params

  • Loading branch information...
rpl committed Aug 4, 2015
1 parent ca93406 commit e8f929e18ee778c9bc19a39a5e97fc5bce7682df
Showing with 9 additions and 14 deletions.
  1. +9 −14 components/CommandLine.js
View
@@ -50,23 +50,19 @@ MozReplCommandLineHandler.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
handle: function(cmdLine) {
var start;
var start, port, contextWindowType;
try {
start = cmdLine.handleFlag('repl', false);
} catch (e) {}
port = cmdLine.handleFlagWithParam('repl', false);
} catch (e) {
start = cmdLine.handleFlag('repl', false)
}
var contextWindowType;
try {
contextWindowType = cmdLine.handleFlagWithParam('repl-context', false);
} catch(e) {}
var port;
try {
var port = parseInt(cmdLine.handleFlagWithParam('repl-port', false));
} catch(e) {}
if(start || port || contextWindowType) {
port = port || srvPref.getIntPref('port');
port = parseInt(port) || srvPref.getIntPref('port');
var loopbackOnly = srvPref.getBoolPref('loopbackOnly');
var service = Cc['@hyperstruct.net/mozlab/mozrepl;1']
@@ -80,10 +76,9 @@ MozReplCommandLineHandler.prototype = {
}
},
helpInfo: ['-repl Start REPL.\n',
'-repl-context Start in the context gives as window type (see XUL windowtype attribute).\n',
'-repl-port <num> Specify access port.\n'].join('')
helpInfo: ['-repl [PORT] Start REPL (PORT defaults to 4242).\n',
'-repl-context Start in the context gives as window type (see XUL windowtype attribute).\n'
].join('')
};
/**

0 comments on commit e8f929e

Please sign in to comment.