diff options
author | Waqas Hussain <waqas20@gmail.com> | 2010-07-26 00:59:26 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2010-07-26 00:59:26 +0500 |
commit | 3f4c880caac77daba383a663a812177e65827fac (patch) | |
tree | c027804c6c706a1f9b75891f32c3045cdb254d4b | |
parent | 147205d667f038b70d7c55052bc4bd9dbb60bfec (diff) | |
download | prosody-3f4c880caac77daba383a663a812177e65827fac.tar.gz prosody-3f4c880caac77daba383a663a812177e65827fac.zip |
mod_console: Added support for multiple arguments to print().
-rw-r--r-- | plugins/mod_console.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index e87ef536..20d04afe 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -36,7 +36,13 @@ function console:new_session(conn) local w = function(s) conn:write(s:gsub("\n", "\r\n")); end; local session = { conn = conn; send = function (t) w(tostring(t)); end; - print = function (t) w("| "..tostring(t).."\n"); end; + print = function (...) + local t = {}; + for i=1,select("#", ...) do + t[i] = tostring(select(i, ...)); + end + w("| "..table.concat(t, "\t").."\n"); + end; disconnect = function () conn:close(); end; }; session.env = setmetatable({}, default_env_mt); |