Comparison

util/prosodyctl/shell.lua @ 12573:0f4feaf9ca64

util: Remove various Lua 5.1 compatibility hacks Part of #1600
author Kim Alvefur <zash@zash.se>
date Sat, 02 Jul 2022 17:31:14 +0200
parent 12539:cfdc8cca64d3
child 12864:9f9633364044
comparison
equal deleted inserted replaced
12572:35a9ed6b7896 12573:0f4feaf9ca64
78 end 78 end
79 79
80 if arg[1] then 80 if arg[1] then
81 if arg[2] then 81 if arg[2] then
82 -- prosodyctl shell module reload foo bar.com --> module:reload("foo", "bar.com") 82 -- prosodyctl shell module reload foo bar.com --> module:reload("foo", "bar.com")
83 -- COMPAT Lua 5.1 doesn't have the separator argument to string.rep 83 arg[1] = string.format("%s:%s("..string.rep("%q", #arg-2,", ")..")", unpack(arg));
84 arg[1] = string.format("%s:%s("..string.rep("%q, ", #arg-2):sub(1, -3)..")", unpack(arg));
85 end 84 end
86 85
87 client.events.add_handler("connected", function() 86 client.events.add_handler("connected", function()
88 client.send(st.stanza("repl-input"):text(arg[1])); 87 client.send(st.stanza("repl-input"):text(arg[1]));
89 return true; 88 return true;