2022-02-25 15:41:27 +01:00
|
|
|
const logger = require('./logger.js');
|
2022-03-03 20:59:12 +01:00
|
|
|
const controller = require('./controller.js');
|
2022-03-01 22:14:36 +01:00
|
|
|
const constants = require('./constants.js');
|
2022-02-25 15:41:27 +01:00
|
|
|
|
|
|
|
async function handleArguments() {
|
|
|
|
let handled = 0;
|
|
|
|
for (let index = 0; index < process.argv.length; index++) {
|
|
|
|
switch (process.argv[index]) {
|
2022-03-01 22:14:36 +01:00
|
|
|
case constants.ARG_CONFIG:
|
2022-02-25 15:41:27 +01:00
|
|
|
continue;
|
2022-03-01 22:14:36 +01:00
|
|
|
case constants.ARG_GET_SERIALS:
|
2022-03-03 20:59:12 +01:00
|
|
|
logger.info('blinksticks: ' + JSON.stringify(await controller.findBlinkstick(constants.ALL)));
|
2022-02-25 15:41:27 +01:00
|
|
|
handled++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return handled > 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
2022-03-01 22:14:36 +01:00
|
|
|
handleArguments
|
2022-02-25 15:41:27 +01:00
|
|
|
};
|