Software /
code /
prosody
Comparison
util/startup.lua @ 10603:dbd60f473164 0.11 0.11.5
util.startup: Ensure prosody.opts exists even when no options provided
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 19 Jan 2020 15:50:32 +0000 |
parent | 10602:f23add0df461 |
child | 10604:3b0d9919f361 |
child | 10947:801b9d5957a6 |
comparison
equal
deleted
inserted
replaced
10602:f23add0df461 | 10603:dbd60f473164 |
---|---|
15 local short_params = { D = "daemonize", F = "no-daemonize" }; | 15 local short_params = { D = "daemonize", F = "no-daemonize" }; |
16 local value_params = { config = true }; | 16 local value_params = { config = true }; |
17 | 17 |
18 function startup.parse_args() | 18 function startup.parse_args() |
19 local parsed_opts = {}; | 19 local parsed_opts = {}; |
20 prosody.opts = parsed_opts; | |
20 | 21 |
21 if #arg == 0 then | 22 if #arg == 0 then |
22 return; | 23 return; |
23 end | 24 end |
24 while true do | 25 while true do |
62 end | 63 end |
63 end | 64 end |
64 end | 65 end |
65 parsed_opts[param_k] = param_v; | 66 parsed_opts[param_k] = param_v; |
66 end | 67 end |
67 prosody.opts = parsed_opts; | |
68 end | 68 end |
69 | 69 |
70 function startup.read_config() | 70 function startup.read_config() |
71 local filenames = {}; | 71 local filenames = {}; |
72 | 72 |