# HG changeset patch # User Matthew Wild # Date 1262901925 0 # Node ID c5f04bdc7c647562e38863a885359dc6c2208c88 # Parent 19c5a66837edf55e459ecf493d6a82910ead1f9e clix, clix.raw: Move 'Connected as' to clix_connect(), and suppress on -q/--quiet diff -r 19c5a66837ed -r c5f04bdc7c64 clix.lua --- a/clix.lua Thu Jan 07 21:24:47 2010 +0000 +++ b/clix.lua Thu Jan 07 22:05:25 2010 +0000 @@ -9,8 +9,8 @@ require "verse.client" -- Global to allow commands to add to it -short_opts = { v = "verbose", t = "to", f = "from", e = "type", a = "account", - p = "password", r = "resource", o = "presence", c = "chatroom" } +short_opts = { v = "verbose", q = "quiet", t = "to", f = "from", e = "type", + a = "account", p = "password", r = "resource", o = "presence", c = "chatroom" } local command = arg[1]; @@ -75,7 +75,9 @@ conn:close(); end); conn:hook("binding-success", function () - conn:debug("Connected: "..tostring(conn)); + if not opts.quiet then + io.stderr:write("clix: connected as ", conn.jid, "\n"); + end if opts.chatroom then conn:send(verse.presence{to=opts.to.."/"..(opts.nick or "clix")}); end diff -r 19c5a66837ed -r c5f04bdc7c64 clix/raw.lua --- a/clix/raw.lua Thu Jan 07 21:24:47 2010 +0000 +++ b/clix/raw.lua Thu Jan 07 22:05:25 2010 +0000 @@ -4,7 +4,6 @@ return function (opts, args) local function on_connect(conn) conn:hook("incoming-raw", print); - io.stderr:write("Connected as ", conn.jid, "\n"); if opts.interactive or opts.stdin then local stdin = { getfd = function () return 0; end;