mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Provide a default help message for commands without help.
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
parent
e421722960
commit
333067c151
@ -214,7 +214,10 @@ def getHelp(method, name=None, doc=None):
|
|||||||
if name is None:
|
if name is None:
|
||||||
name = method.__name__
|
name = method.__name__
|
||||||
if doc is None:
|
if doc is None:
|
||||||
doclines = method.__doc__.splitlines()
|
if method.__doc__ is None:
|
||||||
|
doclines = ['This command has no help. Complain to the author.']
|
||||||
|
else:
|
||||||
|
doclines = method.__doc__.splitlines()
|
||||||
else:
|
else:
|
||||||
doclines = doc.splitlines()
|
doclines = doc.splitlines()
|
||||||
s = '%s %s' % (name, doclines.pop(0))
|
s = '%s %s' % (name, doclines.pop(0))
|
||||||
|
@ -550,6 +550,9 @@ class SourceNestedPluginTestCase(PluginTestCase):
|
|||||||
"""
|
"""
|
||||||
irc.reply('f')
|
irc.reply('f')
|
||||||
|
|
||||||
|
def empty(self, irc, msg, args):
|
||||||
|
pass
|
||||||
|
|
||||||
class g(callbacks.Commands):
|
class g(callbacks.Commands):
|
||||||
def h(self, irc, msg, args):
|
def h(self, irc, msg, args):
|
||||||
"""takes no arguments
|
"""takes no arguments
|
||||||
@ -588,6 +591,7 @@ class SourceNestedPluginTestCase(PluginTestCase):
|
|||||||
self.assertResponse('e g h', 'h')
|
self.assertResponse('e g h', 'h')
|
||||||
self.assertResponse('e g i j', 'j')
|
self.assertResponse('e g i j', 'j')
|
||||||
self.assertHelp('help f')
|
self.assertHelp('help f')
|
||||||
|
self.assertHelp('help empty')
|
||||||
self.assertHelp('help same')
|
self.assertHelp('help same')
|
||||||
self.assertHelp('help e g h')
|
self.assertHelp('help e g h')
|
||||||
self.assertHelp('help e g i j')
|
self.assertHelp('help e g i j')
|
||||||
|
Loading…
Reference in New Issue
Block a user