Commit 73bbbd96 authored by chaz's avatar chaz 👻

Add --help

parent c5b13b4f
......@@ -5,6 +5,7 @@
var http = require('http');
var parseArgs = require('minimist');
var path = require('path');
var readline = require('readline');
var serialport = require('serialport');
......@@ -27,7 +28,22 @@
});
};
var argv = parseArgs(process.argv.slice(2));
var argv = parseArgs(process.argv.slice(2), {
'boolean': ['help', 'listen'],
});
if (argv.help) {
console.info("Usage: " + path.basename(process.argv[1])
+ " [OPTION...]");
console.info("Data-pushing tool for Arduino and other serial devices");
console.info();
console.info(" --baud=BAUD Baud rate (default: 9600)");
console.info(" --device=DEVICE Use DEVICE, don't search for one");
console.info(" --listen Start HTTP server");
console.info(" --port=PORT HTTP server port (default: 8080)");
console.info(" --prompt=PROMPT Readline prompt");
process.exit(0);
}
var path = argv.device || undefined;
var baud = argv.baud || 9600;
......@@ -125,7 +141,7 @@
console.error("No device found; specify path with --device.");
process.exit(1);
}
console.info("Found device " + path + "; override with --device.");
console.info("Found device: " + path);
onPath(path);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment