[Startup] Stop using -h for aliasing --host (#2544)

This solves #2543 and includes documentation for the --host flag in the
help dialog.
This commit is contained in:
Javier Revillas 2019-11-20 00:06:41 +01:00 committed by Andrew Henry
parent 14e8c7a401
commit 3f6f893e29

11
app.js
View File

@ -19,7 +19,7 @@
// Defaults
options.port = options.port || options.p || 8080;
options.host = options.host || options.h || 'localhost'
options.host = options.host || 'localhost'
options.directory = options.directory || options.D || '.';
['include', 'exclude', 'i', 'x'].forEach(function (opt) {
options[opt] = options[opt] || [];
@ -34,10 +34,11 @@
if (options.help || options.h) {
console.log("\nUsage: node app.js [options]\n");
console.log("Options:");
console.log(" --help, -h Show this message.");
console.log(" --port, -p <number> Specify port.");
console.log(" --include, -i <bundle> Include the specified bundle.");
console.log(" --exclude, -x <bundle> Exclude the specified bundle.");
console.log(" --help, -h Show this message.");
console.log(" --port, -p <number> Specify port.");
console.log(" --host <host> Specify host to listen on.");
console.log(" --include, -i <bundle> Include the specified bundle.");
console.log(" --exclude, -x <bundle> Exclude the specified bundle.");
console.log(" --directory, -D <bundle> Serve files from specified directory.");
console.log("");
process.exit(0);