aboutsummaryrefslogtreecommitdiffstats
path: root/util/startup.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-10-25 15:46:01 +0200
committerKim Alvefur <zash@zash.se>2021-10-25 15:46:01 +0200
commit7791f88775b7e1ff14b793afbae4c2b74b591307 (patch)
treeb1795846b2f7c400691370752fccfe7887791d2c /util/startup.lua
parentef6cb64b9edf578685bedc02f72ed27bbc1d974f (diff)
downloadprosody-7791f88775b7e1ff14b793afbae4c2b74b591307.tar.gz
prosody-7791f88775b7e1ff14b793afbae4c2b74b591307.zip
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.
Diffstat (limited to 'util/startup.lua')
-rw-r--r--util/startup.lua9
1 files changed, 8 insertions, 1 deletions
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