Changeset

10874:98c535531450

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.
author Kim Alvefur <zash@zash.se>
date Tue, 02 Jun 2020 09:19:07 +0200
parents 10873:813e632431e6
children 10875:09674bbb833f
files util/prosodyctl/shell.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/prosodyctl/shell.lua	Tue Jun 02 09:07:29 2020 +0200
+++ b/util/prosodyctl/shell.lua	Tue Jun 02 09:19:07 2020 +0200
@@ -10,6 +10,7 @@
 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 @@
 
 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 @@
 		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