aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-09-30 17:47:00 +0200
committerKim Alvefur <zash@zash.se>2021-09-30 17:47:00 +0200
commitd0026b7941a96407487398d32fafb0171ad34906 (patch)
tree3f21aa446f3a4f3f23ef5f82604f301cd8f97bcf
parentf2442d9bd5c0f9a4145208c329112a7798baea62 (diff)
downloadprosody-d0026b7941a96407487398d32fafb0171ad34906.tar.gz
prosody-d0026b7941a96407487398d32fafb0171ad34906.zip
util.startup: Allow separate command line argument settings for prosody and prosodyctl
Makes it clearer that prosody does not take -v atm, as well as how prosodyctl does not take the demonization flags.
-rw-r--r--util/startup.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/util/startup.lua b/util/startup.lua
index 9d0253bc..669e3124 100644
--- a/util/startup.lua
+++ b/util/startup.lua
@@ -22,14 +22,19 @@ local default_gc_params = {
minor_threshold = 20, major_threshold = 50;
};
-local short_params = { D = "daemonize", F = "no-daemonize", v = "verbose" };
-local value_params = { config = true };
+local arg_settigs = {
+ prosody = {
+ short_params = { D = "daemonize"; F = "no-daemonize" };
+ value_params = { config = true };
+ };
+ prosodyctl = {
+ short_params = { v = "verbose" };
+ value_params = { config = true };
+ };
+}
function startup.parse_args()
- local opts, err, where = parse_args(arg, {
- short_params = short_params,
- value_params = value_params,
- });
+ local opts, err, where = parse_args(arg, arg_settigs[prosody.process_type]);
if not opts then
if err == "param-not-found" then
print("Unknown command-line option: "..tostring(where));