From 083a2620d8562fc5834996eb39f968a74198332b Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 4 Apr 2021 18:37:04 +0200 Subject: [PATCH] Daily commit --- src/index.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 448e439..1ec7d69 100644 --- a/src/index.js +++ b/src/index.js @@ -105,4 +105,20 @@ let executeoption = async (option) => { } /* BODY */ -whattodo(whattodoMessage, executeoption) +let commandLineUtility = () => { + console.log(process.argv) + if(process.argv.length==3){ + const option = process.argv[2] // e.g., npm start 15 <- + const optionNum = Number(option) + if(!isNaN(optionNum)){ + executeoption(optionNum) + }else if(option == "all"){ + executeoption(15) // 15 = execute all fetchers + }else{ + whattodo(whattodoMessage, executeoption) + } + }else( + whattodo(whattodoMessage, executeoption) + ) +} +commandLineUtility()