Comparison

prosodyctl @ 12267:a52a0680fcd8

prosodyctl: Allow passing server on command line with --server Because why not I guess. This mirrors the corresponding luarocks command
author Kim Alvefur <zash@zash.se>
date Fri, 04 Feb 2022 19:04:32 +0100
parent 12266:24b0c4c4e28a
child 12292:7fe5cd8a10e2
comparison
equal deleted inserted replaced
12266:24b0c4c4e28a 12267:a52a0680fcd8
81 if opts.help or not arg[1] then 81 if opts.help or not arg[1] then
82 show_usage([[install]], [[Installs a prosody/luarocks plugin]]); 82 show_usage([[install]], [[Installs a prosody/luarocks plugin]]);
83 return opts.help and 0 or 1; 83 return opts.help and 0 or 1;
84 end 84 end
85 -- TODO finalize config option name 85 -- TODO finalize config option name
86 local server = configmanager.get("*", "plugin_server"); 86 local server = opts.server or configmanager.get("*", "plugin_server");
87 if not (arg[1]:match("^https://") or lfs.attributes(arg[1]) or server) then 87 if not (arg[1]:match("^https://") or lfs.attributes(arg[1]) or server) then
88 show_warning("There is no 'plugin_server' option in the configuration file"); 88 show_warning("There is no 'plugin_server' option in the configuration file");
89 -- see https://prosody.im/doc/TODO documentation 89 -- see https://prosody.im/doc/TODO documentation
90 -- #1602 90 -- #1602
91 return 1; 91 return 1;