diff options
author | Kim Alvefur <zash@zash.se> | 2019-01-10 14:54:34 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-01-10 14:54:34 +0100 |
commit | e31667cf151d9d81cf2ab16eece72e559983fb52 (patch) | |
tree | 440ac484334659bd6f7d4b9f7216417a6c3b9582 /prosodyctl | |
parent | 45b1245e12ee56a85bb8fb942f98673902fd706f (diff) | |
download | prosody-e31667cf151d9d81cf2ab16eece72e559983fb52.tar.gz prosody-e31667cf151d9d81cf2ab16eece72e559983fb52.zip |
prosodyctl: Pass the original argv table to subcommands (with first argument removed)
This preserves eg arg[-1] where you might find the path to the Lua
executable, which can be useful.
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -83,7 +83,7 @@ local jid_split = require "util.jid".prepped_split; local prosodyctl_timeout = (configmanager.get("*", "prosodyctl_timeout") or 5) * 2; ----------------------- local commands = {}; -local command = arg[1]; +local command = table.remove(arg, 1); function commands.adduser(arg) if not arg[1] or arg[1] == "--help" then @@ -1365,7 +1365,7 @@ local command_runner = async.runner(function () os.exit(0); end - os.exit(commands[command]({ select(2, unpack(arg)) })); + os.exit(commands[command](arg)); end, watchers); command_runner:run(true); |