From fbd08fe7040d3df686542cd30ad9001b415e043c Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sun, 26 Oct 2003 17:39:01 +0000 Subject: [PATCH] Added the plugin name to the command if the command is abiguous. --- src/Misc.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Misc.py b/src/Misc.py index 4bf211317..3ef471c19 100755 --- a/src/Misc.py +++ b/src/Misc.py @@ -166,13 +166,20 @@ class Misc(callbacks.Privmsg): returning a list of the commands containing that string. """ s = privmsgs.getArgs(args) + commands = {} L = [] for cb in irc.callbacks: if isinstance(cb, callbacks.Privmsg) and \ not isinstance(cb, callbacks.PrivmsgRegexp): for attr in dir(cb): if s in attr and cb.isCommand(attr): - L.append(callbacks.canonicalName(attr)) + commands.setdefault(attr, []).append(cb.name()) + for (key, names) in commands.iteritems(): + if len(names) == 1: + L.append(key) + else: + for name in names: + L.append('%s %s' % (name, key)) L.sort() irc.reply(msg, utils.commaAndify(L))