mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 12:33:07 +00:00
Merge pull request #929 from msaun008/msaun008/fix-command-line-arg-parsing
Update arg parsing and default 'lounge' to 'lounge --help'
This commit is contained in:
commit
24bd39361b
3 changed files with 11 additions and 13 deletions
|
@ -13,7 +13,7 @@
|
|||
"homepage": "https://thelounge.github.io/",
|
||||
"scripts": {
|
||||
"coverage": "nyc mocha",
|
||||
"start": "node index",
|
||||
"start": "node index start",
|
||||
"start-dev": "npm-run-all --parallel watch start",
|
||||
"build": "npm-run-all build:*",
|
||||
"build:font-awesome": "node scripts/build-fontawesome.js",
|
||||
|
|
|
@ -9,11 +9,9 @@ var fsextra = require("fs-extra");
|
|||
var path = require("path");
|
||||
var Helper = require("../helper");
|
||||
|
||||
program.version(Helper.getVersion(), "-v, --version");
|
||||
program.option("");
|
||||
program.option(" --home <path>" , "home path");
|
||||
|
||||
var argv = program.parseOptions(process.argv);
|
||||
program.version(Helper.getVersion(), "-v, --version")
|
||||
.option("-h, --home <path>", "path to configuration folder")
|
||||
.parseOptions(process.argv);
|
||||
|
||||
Helper.setHome(program.home || process.env.LOUNGE_HOME);
|
||||
|
||||
|
@ -40,8 +38,8 @@ require("./remove");
|
|||
require("./reset");
|
||||
require("./edit");
|
||||
|
||||
program.parse(argv.args);
|
||||
program.parse(process.argv);
|
||||
|
||||
if (!program.args.length) {
|
||||
program.parse(process.argv.concat("start"));
|
||||
program.help();
|
||||
}
|
||||
|
|
|
@ -8,11 +8,11 @@ var Helper = require("../helper");
|
|||
|
||||
program
|
||||
.command("start")
|
||||
.option("-H, --host <ip>", "host")
|
||||
.option("-P, --port <port>", "port")
|
||||
.option("-B, --bind <ip>", "bind")
|
||||
.option(" --public", "mode")
|
||||
.option(" --private", "mode")
|
||||
.option("-H, --host <ip>", "set the IP address or hostname for the web server to listen on")
|
||||
.option("-P, --port <port>", "set the port to listen on")
|
||||
.option("-B, --bind <ip>", "set the local IP to bind to for outgoing connections")
|
||||
.option(" --public", "start in public mode")
|
||||
.option(" --private", "start in private mode")
|
||||
.description("Start the server")
|
||||
.action(function(options) {
|
||||
var users = new ClientManager().getUsers();
|
||||
|
|
Loading…
Reference in a new issue