# HG changeset patch # User Kim Alvefur # Date 1619364058 -7200 # Node ID 0a464a6e88c43036c87e865dd3185dbe096f8913 # Parent df4bd3af4099599ed391754375af322c985b0fdc util.prosodyctl.shell: Allow calling console commands with fewer shell quotes E.g. `prosodyctl shell module reload disco example.com` becomes equivalent to `prosodyctl shell 'module:reload("disco", "example.com")`. Won't work for every possible command, but reduces the amount of shell quoting problems for most common commands. diff -r df4bd3af4099 -r 0a464a6e88c4 util/prosodyctl/shell.lua --- a/util/prosodyctl/shell.lua Thu Apr 15 15:57:24 2021 +0200 +++ b/util/prosodyctl/shell.lua Sun Apr 25 17:20:58 2021 +0200 @@ -73,9 +73,8 @@ if arg[1] then if arg[2] then - -- TODO send each arg[] and wait for reply? - print("Only one command is supported as argument"); - os.exit(1); + -- prosodyctl shell module reload foo bar.com --> module:reload("foo", "bar.com") + arg[1] = string.format("%s:%s("..string.rep("%q", #arg-2, ", ")..")", table.unpack(arg)); end client.events.add_handler("connected", function()