# HG changeset patch # User Kim Alvefur # Date 1633016820 -7200 # Node ID 4fad0ca42f6604df03cccf75adcb24fe46c53cd1 # Parent 024ac556e9077ce5d05c92c51ab3b538c883b623 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. diff -r 024ac556e907 -r 4fad0ca42f66 util/startup.lua --- a/util/startup.lua Thu Sep 30 17:45:43 2021 +0200 +++ b/util/startup.lua Thu Sep 30 17:47:00 2021 +0200 @@ -22,14 +22,19 @@ 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));