Added search command.

This commit is contained in:
Jeremy Fincher 2004-01-31 01:37:01 +00:00
parent ef794aecb0
commit da99f93d4a
1 changed files with 16 additions and 0 deletions

View File

@ -118,6 +118,22 @@ class Config(callbacks.Privmsg):
else:
irc.error('%r is not a valid configuration group.' % name)
def search(self, irc, msg, args):
"""<word>
Searches for <word> in the current configuration variables.
"""
word = privmsgs.getArgs(args)
word = word.lower()
L = []
for (name, _) in conf.supybot.getValues(getChildren=True):
if word in name.lower():
L.append(name)
if L:
irc.reply(utils.commaAndify(L))
else:
irc.reply('There were no matching configuration variables.')
def config(self, irc, msg, args):
"""<name> [<value>]