clix.*: Add --short-help and make sure they are working correctly

Tue, 12 Jan 2010 02:17:38 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 12 Jan 2010 02:17:38 +0000
changeset 27
5b58c002d6ad
parent 26
028c5ffc6d7c
child 28
c2998f70dfd4

clix.*: Add --short-help and make sure they are working correctly

clix/bounce.lua file | annotate | diff | comparison | revisions
clix/mirror.lua file | annotate | diff | comparison | revisions
clix/raw.lua file | annotate | diff | comparison | revisions
clix/receive.lua file | annotate | diff | comparison | revisions
clix/send.lua file | annotate | diff | comparison | revisions
clix/version.lua file | annotate | diff | comparison | revisions
--- a/clix/bounce.lua	Tue Jan 12 02:17:03 2010 +0000
+++ b/clix/bounce.lua	Tue Jan 12 02:17:38 2010 +0000
@@ -1,6 +1,10 @@
 short_opts.h = "history";
 
 return function (opts, arg)
+	if opts.short_help then
+		print("Bounce received messages to another JID");
+		return;
+	end
 	local function on_connect(conn)
 		-- Allow selective bouncing
 		local only_node, only_server, only_resource;
--- a/clix/mirror.lua	Tue Jan 12 02:17:03 2010 +0000
+++ b/clix/mirror.lua	Tue Jan 12 02:17:38 2010 +0000
@@ -1,4 +1,8 @@
 return function (opts, arg)
+	if opts.short_help then
+		print("Echo received stanzas back to sender");
+		return;
+	end
 	local function on_connect(conn)
 		local function on_stanza(stanza)
 			if stanza.name == "presence" and opts.presence
--- a/clix/raw.lua	Tue Jan 12 02:17:03 2010 +0000
+++ b/clix/raw.lua	Tue Jan 12 02:17:38 2010 +0000
@@ -2,6 +2,10 @@
 short_opts.e = "echo";
 
 return function (opts, args)
+	if opts.short_help then
+		print("Send/receive raw XML to/from the server");
+		return;
+	end
 	local function on_connect(conn)
 		conn:hook("incoming-raw", print);
 		if opts.interactive or opts.stdin then
--- a/clix/receive.lua	Tue Jan 12 02:17:03 2010 +0000
+++ b/clix/receive.lua	Tue Jan 12 02:17:38 2010 +0000
@@ -1,6 +1,10 @@
 short_opts.h = "history";
 
 return function (opts, args)
+	if opts.short_help then
+		print("Receive and display XMPP messages");
+		return;
+	end
 	local function on_message(message)
 		local body = message:get_child("body");
 		local delay = message:get_child("delay", "urn:xmpp:delay");
--- a/clix/send.lua	Tue Jan 12 02:17:03 2010 +0000
+++ b/clix/send.lua	Tue Jan 12 02:17:38 2010 +0000
@@ -2,6 +2,10 @@
 short_opts.e = "echo";
 
 return function (opts, arg)
+	if opts.short_help then
+		print("Send messages");
+		return;
+	end
 	if (#arg == 0 or opts.help) and not opts.interactive then
 		return 0;
 	end
--- a/clix/version.lua	Tue Jan 12 02:17:03 2010 +0000
+++ b/clix/version.lua	Tue Jan 12 02:17:38 2010 +0000
@@ -1,4 +1,8 @@
 return function (opts, arg)
+	if opts.short_help then
+		print("Query for the software of a client/server");
+		return;
+	end
 	if #arg == 0 or opts.help then
 		return 0;
 	end

mercurial