# HG changeset patch # User Kim Alvefur # Date 1635169561 -7200 # Node ID d52a73425eba1863778765ddaaf83c9dc7de8953 # Parent ae093c259da2ebdb90a45de8d65e72e92b41f0a7 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. diff -r ae093c259da2 -r d52a73425eba util/startup.lua --- 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