util/startup.lua
changeset 10940 d770435f0f84
parent 10938 b4daa697a7ea
child 10952 bebb384090b0
--- a/util/startup.lua	Mon Jun 15 14:23:47 2020 +0100
+++ b/util/startup.lua	Wed Jun 17 19:32:12 2020 +0200
@@ -20,10 +20,20 @@
 local value_params = { config = true };
 
 function startup.parse_args()
-	prosody.opts = parse_args(arg, {
+	local opts, err, where = parse_args(arg, {
 			short_params = short_params,
 			value_params = value_params,
 		});
+	if not opts then
+		if err == "param-not-found" then
+			print("Unknown command-line option: "..tostring(where));
+			print("Perhaps you meant to use prosodyctl instead?");
+		elseif err == "missing-value" then
+			print("Expected a value to follow command-line option: "..where);
+		end
+		os.exit(1);
+	end
+	prosody.opts = opts;
 end
 
 function startup.read_config()