From afeb8f3f7c1edade3c33003ad776758c77c8706c Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Wed, 17 Nov 2010 17:30:53 -0500 Subject: Made echo client print help message. If the jid and password are not supplied, the options list will be displayed instead of hanging trying to connect to a nonexistant server. --- examples/echo_client.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples/echo_client.py') diff --git a/examples/echo_client.py b/examples/echo_client.py index 99967d5f..f449ce4e 100755 --- a/examples/echo_client.py +++ b/examples/echo_client.py @@ -105,6 +105,10 @@ if __name__ == '__main__': logging.basicConfig(level=opts.loglevel, format='%(levelname)-8s %(message)s') + if None in [opts.jid, opts.password]: + optp.print_help() + sys.exit(1) + # Setup the EchoBot and register plugins. Note that while plugins may # have interdependencies, the order in which you register them does # not matter. -- cgit v1.2.3