2013-01-23 13:23:47 +08:00
|
|
|
var ConnectionParameters = require(__dirname + '/../lib/connection-parameters');
|
|
|
|
var config = new ConnectionParameters(process.argv[2]);
|
2016-12-17 00:52:20 +08:00
|
|
|
var semver = require('semver')
|
2010-10-25 14:30:14 +08:00
|
|
|
|
2012-05-31 11:12:14 +08:00
|
|
|
for(var i = 0; i < process.argv.length; i++) {
|
|
|
|
switch(process.argv[i].toLowerCase()) {
|
|
|
|
case 'native':
|
2016-12-17 00:52:20 +08:00
|
|
|
if (semver.gte(process.version, '4.0.0')) {
|
|
|
|
config.native = true;
|
2016-12-17 00:57:39 +08:00
|
|
|
} else {
|
|
|
|
console.log('Not running native in node < v4.0.0')
|
2016-12-17 00:52:20 +08:00
|
|
|
}
|
2010-10-25 14:30:14 +08:00
|
|
|
break;
|
2012-05-31 11:12:14 +08:00
|
|
|
case 'binary':
|
|
|
|
config.binary = true;
|
2010-10-25 14:30:14 +08:00
|
|
|
break;
|
2013-08-31 17:23:17 +08:00
|
|
|
case 'down':
|
|
|
|
config.down = true;
|
|
|
|
break;
|
2010-10-25 14:30:14 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-14 13:23:02 +08:00
|
|
|
if(process.env['PG_TEST_NATIVE']) {
|
|
|
|
config.native = true;
|
|
|
|
}
|
|
|
|
|
2010-10-25 14:30:14 +08:00
|
|
|
module.exports = config;
|