prosodyctl shell: Fix invocation with 3+ command arguments
The code correctly inserted the ',' when there was already a "%q" in the
format string, but then the next argument would fail to match because it
inserted ", %q" instead of "%q". The code now matches both, ensuring the
generated code will not produce a syntax error with multiple arguments.
local xpcall = xpcall;
if select(2, xpcall(function (x) return x end, function () end, "test")) ~= "test" then
xpcall = require"prosody.util.compat".xpcall;
end
return {
xpcall = xpcall;
};