From 552af220f49fffc964532305a05148e2362297e1 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Jan 2022 15:16:09 +0100 Subject: util.startup: Allow supplying an argument parsing settings The 'prosody' global is not global this early so there was no way to override the process type field or argument parsing settings from outside, e.g. from the migrator. --- util/startup.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/startup.lua b/util/startup.lua index 68f2d542..5db1c51a 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -33,8 +33,8 @@ local arg_settigs = { }; } -function startup.parse_args() - local opts, err, where = parse_args(arg, arg_settigs[prosody.process_type]); +function startup.parse_args(profile) + local opts, err, where = parse_args(arg, arg_settigs[profile or prosody.process_type] or profile); if not opts then if err == "param-not-found" then print("Unknown command-line option: "..tostring(where)); -- cgit v1.2.3