aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-02 09:19:07 +0200
committerKim Alvefur <zash@zash.se>2020-06-02 09:19:07 +0200
commit425c9cb979bfaae53b4ccf2a19ad1ec5fddac34c (patch)
treea1f111e1fdff9c47919ce77ddf6de68078abddf8
parent0fea1b599ea6d1c1f14d3566797ec148313d4ddb (diff)
downloadprosody-425c9cb979bfaae53b4ccf2a19ad1ec5fddac34c.tar.gz
prosody-425c9cb979bfaae53b4ccf2a19ad1ec5fddac34c.zip
util.prosodyctl.shell: Really fix --socket option
Forgot it stops parsing --foo options at the first argument, so subsequent commands need to parse their own options like this.
-rw-r--r--util/prosodyctl/shell.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/prosodyctl/shell.lua b/util/prosodyctl/shell.lua
index 1d312d3f..8c8769e2 100644
--- a/util/prosodyctl/shell.lua
+++ b/util/prosodyctl/shell.lua
@@ -10,6 +10,7 @@ local config = require "core.configmanager";
local server = require "net.server";
local st = require "util.stanza";
local path = require "util.paths";
+local parse_args = require "util.argparse".parse;
local have_readline, readline = pcall(require, "readline");
@@ -91,6 +92,7 @@ end
local function start(arg) --luacheck: ignore 212/arg
local client = adminstream.client();
+ local opts = parse_args(arg);
client.events.add_handler("connected", function ()
if not arg.quiet then
@@ -114,7 +116,7 @@ local function start(arg) --luacheck: ignore 212/arg
end
end);
- local socket_path = path.resolve_relative_path(prosody.paths.data, prosody.opts.socket or config.get("*", "admin_socket") or "prosody.sock");
+ local socket_path = path.resolve_relative_path(prosody.paths.data, opts.socket or config.get("*", "admin_socket") or "prosody.sock");
local conn = connection(socket_path, client.listeners);
local ok, err = conn:connect();
if not ok then