mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
Misc tidying
This commit is contained in:
parent
a3c14a8d42
commit
add06a7d8f
4 changed files with 11 additions and 4 deletions
|
|
@ -4,6 +4,8 @@ var argv = require('optimist').argv;
|
|||
|
||||
var debug = argv.debug;
|
||||
delete argv.debug;
|
||||
var outputFormat = argv.output;
|
||||
delete argv.output;
|
||||
|
||||
var options = {};
|
||||
for(var key in argv) {
|
||||
|
|
@ -22,6 +24,10 @@ if(debug) Gamedig.debug = true;
|
|||
Gamedig.query(
|
||||
options,
|
||||
function(state) {
|
||||
console.log(state);
|
||||
if(outputFormat == 'pretty') {
|
||||
console.log(JSON.stringify(state,null,' '));
|
||||
} else {
|
||||
console.log(JSON.stringify(state));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue