Diff

clix.lua @ 104:730fcde562ce

clix.lua: Add --raw option for printing raw incoming and outgoing data
author Kim Alvefur <zash@zash.se>
date Sun, 10 Feb 2013 23:59:34 +0100
parent 103:82c21f1d6f46
child 105:a074eaacefe7
line wrap: on
line diff
--- a/clix.lua	Sun Feb 10 23:58:27 2013 +0100
+++ b/clix.lua	Sun Feb 10 23:59:34 2013 +0100
@@ -60,6 +60,10 @@
 	end
 	verse.set_log_handler(io.stderr, opts.quiet and {} or not opts.verbose and {"info", "warn", "error"});
 	local conn = verse.new(verse.new_logger("clix"));
+	if opts.raw then
+		conn:hook("incoming-raw", print, 1000);
+		conn:hook("outgoing-raw", print, 1000);
+	end
 	for _, plugin in ipairs(plugins or {}) do
 		conn:add_plugin(plugin);
 	end