Changeset

23:c5f04bdc7c64

clix, clix.raw: Move 'Connected as' to clix_connect(), and suppress on -q/--quiet
author Matthew Wild <mwild1@gmail.com>
date Thu, 07 Jan 2010 22:05:25 +0000
parents 22:19c5a66837ed
children 24:8e157125957d
files clix.lua clix/raw.lua
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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;