util.startup: Show brief usage on `prosody -h|-?|--help`
Seems more suitable than asking if prosodyctl was meant to be used, or
going ahead and starting.
--- a/util/startup.lua Sun Oct 24 15:17:01 2021 +0200
+++ b/util/startup.lua Mon Oct 25 15:46:01 2021 +0200
@@ -24,7 +24,7 @@
local arg_settigs = {
prosody = {
- short_params = { D = "daemonize"; F = "no-daemonize" };
+ short_params = { D = "daemonize"; F = "no-daemonize", h = "help", ["?"] = "help" };
value_params = { config = true };
};
prosodyctl = {
@@ -46,6 +46,13 @@
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);
+ end
prosody.opts = opts;
end