From ff2a6d764e1dc56197b05c7c1c64b8b5832f0ed1 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 21 Mar 2022 10:06:48 +0000 Subject: util.startup: Show error for unrecognized arguments passed to 'prosody' (fixes #1722) --- util/startup.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/util/startup.lua b/util/startup.lua index ce14df71..ab8b61da 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -46,12 +46,19 @@ function startup.parse_args(profile) end os.exit(1); end - if opts.help and prosody.process_type == "prosody" then - print("prosody [ -D | -F ] [ --config /path/to/prosody.cfg.lua ]"); - print(" -D, --daemonize Run in the background") - print(" -F, --no-daemonize Run in the foreground") - print(" --config FILE Specify config file") - os.exit(0); + if prosody.process_type == "prosody" then + if #arg > 0 then + print("Unrecognized option: "..arg[1]); + print("(Did you mean 'prosodyctl "..arg[1].."'?)"); + print(""); + end + if opts.help or #arg > 0 then + print("prosody [ -D | -F ] [ --config /path/to/prosody.cfg.lua ]"); + print(" -D, --daemonize Run in the background") + print(" -F, --no-daemonize Run in the foreground") + print(" --config FILE Specify config file") + os.exit(0); + end end prosody.opts = opts; end -- cgit v1.2.3