summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-11-17 17:30:53 -0500
committerLance Stout <lancestout@gmail.com>2010-11-17 17:30:53 -0500
commitafeb8f3f7c1edade3c33003ad776758c77c8706c (patch)
treec7de93371042ffa36056b1e5ccdf267342301761 /examples
parentcdbc0570cac6f672a63df2c0368cb045417d942e (diff)
downloadslixmpp-afeb8f3f7c1edade3c33003ad776758c77c8706c.tar.gz
slixmpp-afeb8f3f7c1edade3c33003ad776758c77c8706c.tar.bz2
slixmpp-afeb8f3f7c1edade3c33003ad776758c77c8706c.tar.xz
slixmpp-afeb8f3f7c1edade3c33003ad776758c77c8706c.zip
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.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/echo_client.py4
1 files changed, 4 insertions, 0 deletions
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.