Added search command.

This commit is contained in:
Jeremy Fincher 2004-01-31 01:37:01 +00:00
parent ef794aecb0
commit da99f93d4a

View File

@ -118,6 +118,22 @@ class Config(callbacks.Privmsg):
else: else:
irc.error('%r is not a valid configuration group.' % name) 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): def config(self, irc, msg, args):
"""<name> [<value>] """<name> [<value>]