mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 07:07:33 +00:00
Added givenPortOnly user option
Allows user to disable gamedig's default behavior of adding query attempts using the default query port(-offset)
This commit is contained in:
parent
b99abcd8b3
commit
a362d1d113
3 changed files with 9 additions and 3 deletions
7
bin/gamedig.js
Normal file → Executable file
7
bin/gamedig.js
Normal file → Executable file
|
|
@ -4,13 +4,15 @@ const Minimist = require('minimist'),
|
|||
Gamedig = require('..');
|
||||
|
||||
const argv = Minimist(process.argv.slice(2), {
|
||||
boolean: ['pretty','debug']
|
||||
boolean: ['pretty','debug','givenPortOnly']
|
||||
});
|
||||
|
||||
const debug = argv.debug;
|
||||
delete argv.debug;
|
||||
const pretty = !!argv.pretty || debug;
|
||||
delete argv.pretty;
|
||||
const givenPortOnly = argv.givenPortOnly;
|
||||
delete argv.givenPortOnly;
|
||||
|
||||
const options = {};
|
||||
for(const key of Object.keys(argv)) {
|
||||
|
|
@ -34,6 +36,9 @@ if (argv._.length >= 1) {
|
|||
if (debug) {
|
||||
options.debug = true;
|
||||
}
|
||||
if (givenPortOnly) {
|
||||
options.givenPortOnly = true;
|
||||
}
|
||||
|
||||
Gamedig.query(options)
|
||||
.then((state) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue