Software /
code /
prosody
Comparison
util/startup.lua @ 12423:3ae9299d61d7 0.12
util.startup: Show error for unrecognized arguments passed to 'prosody' (fixes #1722)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 21 Mar 2022 10:06:48 +0000 |
parent | 12294:81f147ddc4ab |
child | 12553:cc0ec0277813 |
comparison
equal
deleted
inserted
replaced
12420:b78b8689173a | 12423:3ae9299d61d7 |
---|---|
44 elseif err == "missing-value" then | 44 elseif err == "missing-value" then |
45 print("Expected a value to follow command-line option: "..where); | 45 print("Expected a value to follow command-line option: "..where); |
46 end | 46 end |
47 os.exit(1); | 47 os.exit(1); |
48 end | 48 end |
49 if opts.help and prosody.process_type == "prosody" then | 49 if prosody.process_type == "prosody" then |
50 print("prosody [ -D | -F ] [ --config /path/to/prosody.cfg.lua ]"); | 50 if #arg > 0 then |
51 print(" -D, --daemonize Run in the background") | 51 print("Unrecognized option: "..arg[1]); |
52 print(" -F, --no-daemonize Run in the foreground") | 52 print("(Did you mean 'prosodyctl "..arg[1].."'?)"); |
53 print(" --config FILE Specify config file") | 53 print(""); |
54 os.exit(0); | 54 end |
55 if opts.help or #arg > 0 then | |
56 print("prosody [ -D | -F ] [ --config /path/to/prosody.cfg.lua ]"); | |
57 print(" -D, --daemonize Run in the background") | |
58 print(" -F, --no-daemonize Run in the foreground") | |
59 print(" --config FILE Specify config file") | |
60 os.exit(0); | |
61 end | |
55 end | 62 end |
56 prosody.opts = opts; | 63 prosody.opts = opts; |
57 end | 64 end |
58 | 65 |
59 function startup.read_config() | 66 function startup.read_config() |