mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-27 21:22:39 +01:00
Added getopt.GetoptError to exceptions to return help on.
This commit is contained in:
parent
b8550ab31d
commit
ab562416bf
@ -45,6 +45,7 @@ import new
|
||||
import sets
|
||||
import time
|
||||
import shlex
|
||||
import getopt
|
||||
import inspect
|
||||
import threading
|
||||
import sre_constants
|
||||
@ -298,7 +299,7 @@ class IrcObjectProxy:
|
||||
# If self.irc is an actual irclib.Irc, then this is the
|
||||
# first command given, and should be ignored as usual.
|
||||
self.reply(self.msg, '[%s]' % ' '.join(self.args))
|
||||
except ArgumentError:
|
||||
except (getopt.GetoptError, ArgumentError):
|
||||
if hasattr(command, '__doc__'):
|
||||
s = '%s %s' % (name, command.__doc__.splitlines()[0])
|
||||
else:
|
||||
@ -365,7 +366,7 @@ class CommandThread(threading.Thread):
|
||||
elapsed = time.time() - start
|
||||
debug.msg('%s took %s seconds.' % \
|
||||
(self.commandName, elapsed), 'verbose')
|
||||
except ArgumentError:
|
||||
except (getopt.GetoptError, ArgumentError):
|
||||
if hasattr(self.command, '__doc__'):
|
||||
help = self.command.__doc__.splitlines()[0]
|
||||
s = '%s %s' % (self.commandName, help)
|
||||
|
Loading…
Reference in New Issue
Block a user