Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/server/aphlict_server.js
Show All 16 Lines | var config = { | ||||
'ssl-cert': null, | 'ssl-cert': null, | ||||
test: false | test: false | ||||
}; | }; | ||||
for (var ii = 2; ii < argv.length; ii++) { | for (var ii = 2; ii < argv.length; ii++) { | ||||
var arg = argv[ii]; | var arg = argv[ii]; | ||||
var matches = arg.match(/^--([^=]+)=(.*)$/); | var matches = arg.match(/^--([^=]+)=(.*)$/); | ||||
if (!matches) { | if (!matches) { | ||||
throw new Error("Unknown argument '" + arg + "'!"); | throw new Error('Unknown argument "' + arg + '"!'); | ||||
} | } | ||||
if (!(matches[1] in config)) { | if (!(matches[1] in config)) { | ||||
throw new Error("Unknown argument '" + matches[1] + "'!"); | throw new Error('Unknown argument "' + matches[1] + '"!'); | ||||
} | } | ||||
config[matches[1]] = matches[2]; | config[matches[1]] = matches[2]; | ||||
} | } | ||||
config['client-port'] = parseInt(config['client-port'], 10); | config['client-port'] = parseInt(config['client-port'], 10); | ||||
config['admin-port'] = parseInt(config['admin-port'], 10); | config['admin-port'] = parseInt(config['admin-port'], 10); | ||||
return config; | return config; | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |