Changeset

11869:d52a73425eba

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.
author Kim Alvefur <zash@zash.se>
date Mon, 25 Oct 2021 15:46:01 +0200
parents 11868:ae093c259da2
children 11870:1d1ed2be3491
files util/startup.lua
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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