Software /
code /
clix
Changeset
27:5b58c002d6ad
clix.*: Add --short-help and make sure they are working correctly
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 12 Jan 2010 02:17:38 +0000 |
parents | 26:028c5ffc6d7c |
children | 28:c2998f70dfd4 |
files | clix/bounce.lua clix/mirror.lua clix/raw.lua clix/receive.lua clix/send.lua clix/version.lua |
diffstat | 6 files changed, 24 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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