summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-08-04 00:44:31 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-08-04 00:44:31 +0000
commitf1c6f0ba07e5abcd980f1e12e8823ce865bfeeed (patch)
tree35400facfde792fa7a84c61e9c3dc8807e9ff586 /lib/rbot/plugins.rb
parent5aa914133c6482c500cf439d65584282212beb6b (diff)
Some fixes for the help system. Still not perfect, but better than before
Diffstat (limited to 'lib/rbot/plugins.rb')
-rw-r--r--lib/rbot/plugins.rb23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index 42ff2aaa..b55fbe4a 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -507,24 +507,23 @@ module Plugins
key = $1
params = $2
(core_modules + plugins).each { |p|
- # debug "checking #{p.name.inspect} against #{key.inspect}"
+ next unless p.name == key
begin
- return p.help(params)
+ return p.help(key, params)
rescue Exception => err
#rescue TimeoutError, StandardError, NameError, SyntaxError => err
error report_error("#{p.botmodule_class} #{p.name} help() failed:", err)
- end if p.name == key
+ end
}
+ k = key.to_sym
[core_commands, plugin_commands].each { |pl|
- # debug "looking for #{key.inspect} in #{pl.keys.sort.inspect}"
- if pl.has_key?(key)
- p = pl[key][:botmodule]
- begin
- return p.help(key, params)
- rescue Exception => err
- #rescue TimeoutError, StandardError, NameError, SyntaxError => err
- error report_error("#{p.botmodule_class} #{p.name} help() failed:", err)
- end
+ next unless pl.has_key?(k)
+ p = pl[k][:botmodule]
+ begin
+ return p.help(p.name, topic)
+ rescue Exception => err
+ #rescue TimeoutError, StandardError, NameError, SyntaxError => err
+ error report_error("#{p.botmodule_class} #{p.name} help() failed:", err)
end
}
end