mod_console: Added support for multiple arguments to print().

Mon, 26 Jul 2010 00:59:26 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Mon, 26 Jul 2010 00:59:26 +0500
changeset 3404
33c81ee280e3
parent 3403
b89680015b7b
child 3405
b1efe62c3c37

mod_console: Added support for multiple arguments to print().

plugins/mod_console.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_console.lua	Mon Jul 26 00:58:19 2010 +0500
+++ b/plugins/mod_console.lua	Mon Jul 26 00:59:26 2010 +0500
@@ -36,7 +36,13 @@
 	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);

mercurial