Added '--public' and '--private' options
This commit is contained in:
parent
a18580645c
commit
3c76399cd0
@ -6,6 +6,8 @@ var shout = require("../server");
|
|||||||
program
|
program
|
||||||
.option("-h, --host <ip>", "host")
|
.option("-h, --host <ip>", "host")
|
||||||
.option("-p, --port <port>", "port")
|
.option("-p, --port <port>", "port")
|
||||||
|
.option(" --public")
|
||||||
|
.option(" --private")
|
||||||
.command("start")
|
.command("start")
|
||||||
.description("Start the server")
|
.description("Start the server")
|
||||||
.action(function() {
|
.action(function() {
|
||||||
@ -18,6 +20,12 @@ program
|
|||||||
} else {
|
} else {
|
||||||
var host = program.host || process.env.IP || config.host;
|
var host = program.host || process.env.IP || config.host;
|
||||||
var port = program.port || process.env.PORT || config.port;
|
var port = program.port || process.env.PORT || config.port;
|
||||||
shout(port, host, config.public);
|
var mode = config.public;
|
||||||
|
if (program.public) {
|
||||||
|
mode = true;
|
||||||
|
} else if (program.private) {
|
||||||
|
mode = false;
|
||||||
|
}
|
||||||
|
shout(port, host, mode);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user