mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 22:51:01 +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 sets
|
||||||
import time
|
import time
|
||||||
import shlex
|
import shlex
|
||||||
|
import getopt
|
||||||
import inspect
|
import inspect
|
||||||
import threading
|
import threading
|
||||||
import sre_constants
|
import sre_constants
|
||||||
@ -298,7 +299,7 @@ class IrcObjectProxy:
|
|||||||
# If self.irc is an actual irclib.Irc, then this is the
|
# If self.irc is an actual irclib.Irc, then this is the
|
||||||
# first command given, and should be ignored as usual.
|
# first command given, and should be ignored as usual.
|
||||||
self.reply(self.msg, '[%s]' % ' '.join(self.args))
|
self.reply(self.msg, '[%s]' % ' '.join(self.args))
|
||||||
except ArgumentError:
|
except (getopt.GetoptError, ArgumentError):
|
||||||
if hasattr(command, '__doc__'):
|
if hasattr(command, '__doc__'):
|
||||||
s = '%s %s' % (name, command.__doc__.splitlines()[0])
|
s = '%s %s' % (name, command.__doc__.splitlines()[0])
|
||||||
else:
|
else:
|
||||||
@ -365,7 +366,7 @@ class CommandThread(threading.Thread):
|
|||||||
elapsed = time.time() - start
|
elapsed = time.time() - start
|
||||||
debug.msg('%s took %s seconds.' % \
|
debug.msg('%s took %s seconds.' % \
|
||||||
(self.commandName, elapsed), 'verbose')
|
(self.commandName, elapsed), 'verbose')
|
||||||
except ArgumentError:
|
except (getopt.GetoptError, ArgumentError):
|
||||||
if hasattr(self.command, '__doc__'):
|
if hasattr(self.command, '__doc__'):
|
||||||
help = self.command.__doc__.splitlines()[0]
|
help = self.command.__doc__.splitlines()[0]
|
||||||
s = '%s %s' % (self.commandName, help)
|
s = '%s %s' % (self.commandName, help)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user