summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-24 00:28:28 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-24 00:28:28 +0200
commit4a5eafbb067aaee8715a55ac52e292ce22b668c8 (patch)
tree63be147db0ce1a11b98697a65c9aa164909fd2bb
parentf5f14237c4099ca854a817288c526366f26a070d (diff)
config core botmodule: bolden keys on search
-rw-r--r--lib/rbot/core/config.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rbot/core/config.rb b/lib/rbot/core/config.rb
index de122dcd..439d7c51 100644
--- a/lib/rbot/core/config.rb
+++ b/lib/rbot/core/config.rb
@@ -72,13 +72,13 @@ class ConfigModule < CoreBotModule
rx = Regexp.new(params[:rx].to_s, true)
cfs = []
@bot.config.items.each do |k, v|
- cfs << v if k.to_s.match(rx) or (v.desc.match(rx) rescue false)
+ cfs << [Bold + k.to_s + Bold, v.desc] if k.to_s.match(rx) or (v.desc.match(rx) rescue false)
end
if cfs.empty?
m.reply _("no config key found matching %{r}") % { :r => params[:rx].to_s}
else
- m.reply _("possible keys: %{kl}") % { :kl => cfs.map { |c| c.key}.join(', ') }
- m.reply cfs.map { |c| [c.key, c.desc].join(': ') }.join("\n")
+ m.reply _("possible keys: %{kl}") % { :kl => cfs.map { |c| c.first}.join(', ') }
+ m.reply cfs.map { |c| c.join(': ') }.join("\n")
end
end