Class: IRB::Command::Help

Inherits:
Base show all
Defined in:
lib/irb/command/help.rb

Instance Attribute Summary

Attributes inherited from Base

#irb_context

Instance Method Summary collapse

Methods inherited from Base

category, description, execute, help_message, #initialize

Constructor Details

This class inherits a constructor from IRB::Command::Base

Instance Method Details

#execute(command_name) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/irb/command/help.rb', line 9

def execute(command_name)
  content =
    if command_name.empty?
      help_message
    else
      if command_class = Command.load_command(command_name)
        command_class.help_message || command_class.description
      else
        "Can't find command `#{command_name}`. Please check the command name and try again.\n\n"
      end
    end
  Pager.page_content(content)
end