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.
This commit is contained in:
Lance Stout 2010-11-17 17:30:53 -05:00
parent cdbc0570ca
commit afeb8f3f7c

View file

@ -105,6 +105,10 @@ if __name__ == '__main__':
logging.basicConfig(level=opts.loglevel, logging.basicConfig(level=opts.loglevel,
format='%(levelname)-8s %(message)s') 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 # Setup the EchoBot and register plugins. Note that while plugins may
# have interdependencies, the order in which you register them does # have interdependencies, the order in which you register them does
# not matter. # not matter.