# HG changeset patch # User Kim Alvefur # Date 1619364747 -7200 # Node ID 5bd38d9197e10d1b5dd94594047339ee079e72aa # Parent 16caf35f031f9b69323fcab1c6d4a96d61abc72d util.prosodyctl.shell: Fix for different location of unpack in Lua 5.1 diff -r 16caf35f031f -r 5bd38d9197e1 util/prosodyctl/shell.lua --- a/util/prosodyctl/shell.lua Sun Apr 25 17:27:02 2021 +0200 +++ b/util/prosodyctl/shell.lua Sun Apr 25 17:32:27 2021 +0200 @@ -3,6 +3,7 @@ local st = require "util.stanza"; local path = require "util.paths"; local parse_args = require "util.argparse".parse; +local unpack = table.unpack or _G.unpack; local have_readline, readline = pcall(require, "readline"); @@ -75,7 +76,7 @@ if arg[2] then -- prosodyctl shell module reload foo bar.com --> module:reload("foo", "bar.com") -- COMPAT Lua 5.1 doesn't have the separator argument to string.rep - arg[1] = string.format("%s:%s("..string.rep("%q, ", #arg-2):sub(1, -3)..")", table.unpack(arg)); + arg[1] = string.format("%s:%s("..string.rep("%q, ", #arg-2):sub(1, -3)..")", unpack(arg)); end client.events.add_handler("connected", function()