Software /
code /
clix
Comparison
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 |
comparison
equal
deleted
inserted
replaced
103:82c21f1d6f46 | 104:730fcde562ce |
---|---|
58 io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n"); | 58 io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n"); |
59 return nil; | 59 return nil; |
60 end | 60 end |
61 verse.set_log_handler(io.stderr, opts.quiet and {} or not opts.verbose and {"info", "warn", "error"}); | 61 verse.set_log_handler(io.stderr, opts.quiet and {} or not opts.verbose and {"info", "warn", "error"}); |
62 local conn = verse.new(verse.new_logger("clix")); | 62 local conn = verse.new(verse.new_logger("clix")); |
63 if opts.raw then | |
64 conn:hook("incoming-raw", print, 1000); | |
65 conn:hook("outgoing-raw", print, 1000); | |
66 end | |
63 for _, plugin in ipairs(plugins or {}) do | 67 for _, plugin in ipairs(plugins or {}) do |
64 conn:add_plugin(plugin); | 68 conn:add_plugin(plugin); |
65 end | 69 end |
66 conn:hook("authentication-failure", function (err) | 70 conn:hook("authentication-failure", function (err) |
67 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or "")); | 71 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or "")); |