]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/alias.rb
weather plugin: refactor HTML cleanup code
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / alias.rb
index 1496755d099dd8db3d51005afb14940d737d2a8f..289ef1ad69513bf48b5f04c082d30de17210e0f9 100644 (file)
@@ -154,7 +154,15 @@ class AliasPlugin < Plugin
   def help(plugin, topic='')
     case topic
     when ''
-      _('Create and use aliases for commands. Topics: create, commands')
+      if plugin == 'alias' # FIXME find out plugin name programmatically
+        _('Create and use aliases for commands. Topics: create, commands')
+      else
+        # show definition of all aliases whose first word is the parameter of the help
+        # command
+        @aliases.keys.select {|a| a[/\A(\w+)/, 1] == plugin}.map do |a|
+          "#{a} => #{@aliases[a]}"
+        end.join ' | '
+      end
     when 'create'
       _('"alias <text> => <command>" => add text as an alias of command. Text can contain placeholders marked with : or * for :words and *multiword arguments. The command can contain placeholders enclosed with < > which will be substituded with argument values. For example: alias googlerbot *terms => google site:linuxbrit.co.uk/rbot/ <terms>')
     when 'commands'