Finish Node CLI

This commit is contained in:
Starbeamrainbowlabs 2019-01-03 18:16:39 +00:00
parent 1c50a56f1d
commit 6fa6ec3f56
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -1,8 +1,31 @@
#!/usr/bin/env node
const settings = { const settings = {
}; };
// Skip the first 2 items - they are node file.js // Skip the first 2 items - they are node file.js
let extras = [];
for(let i = 2; i < process.argv.length; i++) { for(let i = 2; i < process.argv.length; i++) {
if(process.argv[i]) if(!process.argv[i].startsWith("-")) {
extras.push(process.argv[i]);
continue;
}
switch(process.argv[i]) {
case "-h":
case "--help":
console.log("2-way The Things Network LoRa Gateway");
console.log("---- By Starbeamrainbowlabs ---------");
console.log();
console.log("Usage:");
console.log(" ./gateway.js {options}");
console.log("");
console.log("Options:");
console.log(" -h --help Show this message");
console.log("");
console.log("Environment Variables:");
console.log(" (none yet)");
return;
}
} }