blinky/libs/cli.js

22 lines
645 B
JavaScript
Raw Normal View History

2022-02-25 15:41:27 +01:00
const logger = require('./logger.js');
const controller = require('./controller.js');
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]) {
case constants.ARG_CONFIG:
2022-02-25 15:41:27 +01:00
continue;
case constants.ARG_GET_SERIALS:
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 = {
handleArguments
2022-02-25 15:41:27 +01:00
};