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-03-03 21:18:07 +01:00
|
|
|
case constants.ARG_CONFIG_SHORT:
|
2022-02-25 15:41:27 +01:00
|
|
|
continue;
|
2022-03-03 21:18:07 +01:00
|
|
|
case constants.ARG_LIST:
|
|
|
|
case constants.ARG_LIST_SHORT:
|
2022-03-07 23:19:18 +01:00
|
|
|
logger.info('blinksticks: ' + JSON.stringify(await controller.getBlinkstick(constants.ALL, false)));
|
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
|
|
|
};
|