Finish Node CLI
This commit is contained in:
parent
1c50a56f1d
commit
6fa6ec3f56
1 changed files with 24 additions and 1 deletions
25
gateway.js
25
gateway.js
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue