# HG changeset patch # User Matthew Wild # Date 1263262658 0 # Node ID 5b58c002d6adcd327501a0b727225a3b9dbf4381 # Parent 028c5ffc6d7c13485bddaed1d64a0285e3a44901 clix.*: Add --short-help and make sure they are working correctly diff -r 028c5ffc6d7c -r 5b58c002d6ad clix/bounce.lua --- 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; diff -r 028c5ffc6d7c -r 5b58c002d6ad clix/mirror.lua --- 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 diff -r 028c5ffc6d7c -r 5b58c002d6ad clix/raw.lua --- 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 diff -r 028c5ffc6d7c -r 5b58c002d6ad clix/receive.lua --- 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"); diff -r 028c5ffc6d7c -r 5b58c002d6ad clix/send.lua --- 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 diff -r 028c5ffc6d7c -r 5b58c002d6ad clix/version.lua --- 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