mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
Fix line endings in bin for linux
This commit is contained in:
parent
b4472d6d35
commit
3c0de4060c
1 changed files with 33 additions and 33 deletions
|
|
@ -1,33 +1,33 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
var argv = require('optimist').argv;
|
var argv = require('optimist').argv;
|
||||||
|
|
||||||
var debug = argv.debug;
|
var debug = argv.debug;
|
||||||
delete argv.debug;
|
delete argv.debug;
|
||||||
var outputFormat = argv.output;
|
var outputFormat = argv.output;
|
||||||
delete argv.output;
|
delete argv.output;
|
||||||
|
|
||||||
var options = {};
|
var options = {};
|
||||||
for(var key in argv) {
|
for(var key in argv) {
|
||||||
var value = argv[key];
|
var value = argv[key];
|
||||||
if(
|
if(
|
||||||
key == '_'
|
key == '_'
|
||||||
|| key.charAt(0) == '$'
|
|| key.charAt(0) == '$'
|
||||||
|| (typeof value != 'string' && typeof value != 'number')
|
|| (typeof value != 'string' && typeof value != 'number')
|
||||||
)
|
)
|
||||||
continue;
|
continue;
|
||||||
options[key] = value;
|
options[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
var Gamedig = require('../lib/index');
|
var Gamedig = require('../lib/index');
|
||||||
if(debug) Gamedig.debug = true;
|
if(debug) Gamedig.debug = true;
|
||||||
Gamedig.query(
|
Gamedig.query(
|
||||||
options,
|
options,
|
||||||
function(state) {
|
function(state) {
|
||||||
if(outputFormat == 'pretty') {
|
if(outputFormat == 'pretty') {
|
||||||
console.log(JSON.stringify(state,null,' '));
|
console.log(JSON.stringify(state,null,' '));
|
||||||
} else {
|
} else {
|
||||||
console.log(JSON.stringify(state));
|
console.log(JSON.stringify(state));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue