Handle properly the case where no matching commands were found.

This commit is contained in:
Jeremy Fincher 2003-10-27 04:59:54 +00:00
parent a1c911e954
commit fc11ff4f24
2 changed files with 6 additions and 2 deletions

View File

@ -180,8 +180,11 @@ class Misc(callbacks.Privmsg):
else:
for name in names:
L.append('%s %s' % (name, key))
L.sort()
irc.reply(msg, utils.commaAndify(L))
if L:
L.sort()
irc.reply(msg, utils.commaAndify(L))
else:
irc.error(msg, 'No appropriate commands were found.')
def help(self, irc, msg, args):
"""[<plugin>] <command>

View File

@ -142,6 +142,7 @@ class MiscTestCase(ChannelPluginTestCase, PluginDocumentation):
def testApropos(self):
self.assertNotError('apropos f')
self.assertError('apropos asldkfjasdlkfja')