From 07a01b054790c2669a37968e93b503d4b2a8baa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sun, 10 Dec 2017 16:04:13 -0500 Subject: [PATCH] Deprecate existing options of `thelounge start` in favor or `-c, --config` --- src/command-line/start.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/command-line/start.js b/src/command-line/start.js index 2cbaeb00..aa85a3e3 100644 --- a/src/command-line/start.js +++ b/src/command-line/start.js @@ -10,11 +10,11 @@ const Utils = require("./utils"); program .command("start") - .option("-H, --host ", "set the IP address or hostname for the web server to listen on") - .option("-P, --port ", "set the port to listen on") - .option("-B, --bind ", "set the local IP to bind to for outgoing connections") - .option(" --public", "start in public mode") - .option(" --private", "start in private mode") + .option("-H, --host ", `${colors.bold.red("[DEPRECATED]")} to set the IP address or hostname for the web server to listen on, use ${colors.bold("-c host=")} instead`) + .option("-P, --port ", `${colors.bold.red("[DEPRECATED]")} to set the port to listen on, use ${colors.bold("-c port=")} instead`) + .option("-B, --bind ", `${colors.bold.red("[DEPRECATED]")} to set the local IP to bind to for outgoing connections, use ${colors.bold("-c bind=")} instead`) + .option(" --public", `${colors.bold.red("[DEPRECATED]")} to start in public mode, use ${colors.bold("-c public=true")} instead`) + .option(" --private", `${colors.bold.red("[DEPRECATED]")} to start in private mode, use ${colors.bold("-c public=false")} instead`) .description("Start the server") .on("--help", Utils.extraHelp) .action(function(options) { @@ -22,6 +22,22 @@ program const server = require("../server"); + if (options.host) { + log.warn(`${colors.bold("-H, --host ")} is ${colors.bold.red("deprecated")} and will be removed in The Lounge v3. Use ${colors.bold("-c host=")} instead.`); + } + if (options.port) { + log.warn(`${colors.bold("-P, --port ")} is ${colors.bold.red("deprecated")} and will be removed in The Lounge v3. Use ${colors.bold("-c port=")} instead.`); + } + if (options.bind) { + log.warn(`${colors.bold("-B, --bind ")} is ${colors.bold.red("deprecated")} and will be removed in The Lounge v3. Use ${colors.bold("-c bind=")} instead.`); + } + if (options.public) { + log.warn(`${colors.bold("--public")} is ${colors.bold.red("deprecated")} and will be removed in The Lounge v3. Use ${colors.bold("-c public=true")} instead.`); + } + if (options.private) { + log.warn(`${colors.bold("--private")} is ${colors.bold.red("deprecated")} and will be removed in The Lounge v3. Use ${colors.bold("-c public=false")} instead.`); + } + var mode = Helper.config.public; if (options.public) { mode = true;