From 7791f88775b7e1ff14b793afbae4c2b74b591307 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 25 Oct 2021 15:46:01 +0200 Subject: 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. --- util/startup.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'util/startup.lua') diff --git a/util/startup.lua b/util/startup.lua index b4dc6095..890e18ba 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -24,7 +24,7 @@ local default_gc_params = { 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 @@ function startup.parse_args() 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 -- cgit v1.2.3