From 4a5eafbb067aaee8715a55ac52e292ce22b668c8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 24 Apr 2008 00:28:28 +0200 Subject: config core botmodule: bolden keys on search --- lib/rbot/core/config.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/rbot') 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 -- cgit v1.2.3