aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-03-21 10:06:48 +0000
committerMatthew Wild <mwild1@gmail.com>2022-03-21 10:06:48 +0000
commitff2a6d764e1dc56197b05c7c1c64b8b5832f0ed1 (patch)
treefc8ca0236e60e281318c5260a2e4a1d11e32e04d /util
parentdf4ba58b9f44799d8bba2e084ad2ad5696667cc2 (diff)
downloadprosody-ff2a6d764e1dc56197b05c7c1c64b8b5832f0ed1.tar.gz
prosody-ff2a6d764e1dc56197b05c7c1c64b8b5832f0ed1.zip
util.startup: Show error for unrecognized arguments passed to 'prosody' (fixes #1722)
Diffstat (limited to 'util')
-rw-r--r--util/startup.lua19
1 files 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