Class: Debugger::HelpCommand

### Home Classes Methods

### In Files

- lib/ruby-debug/commands/help.rb

### Parent

Debugger::Command

### Methods

- ::help
- ::help_command
- #execute
- #regexp

### Class/Module Index

Quicksearch

- Debugger
- Debugger::AddBreakpoint
- Debugger::Breakpoint
- Debugger::Context
- Debugger::ContinueCommand
- Debugger::DeleteBreakpointCommand
- Debugger::FinishCommand
- Debugger::HelpCommand
- Debugger::IRBCommand
- Debugger::InfoCommand
- Debugger::JumpCommand
- Debugger::KillCommand
- Debugger::ListCommand
- Debugger::LocalInterface
- Debugger::LocalInterface::Debugger
- Debugger::MethodCommand
- Debugger::MethodSigCommand
- Debugger::NextCommand
- Debugger::ParseFunctions
- Debugger::Processor
- Debugger::QuitCommand
- Debugger::ReloadCommand
- Debugger::SetCommand
- Debugger::ShowCommand
- Debugger::SkipCommand
- Debugger::SourceCommand
- Debugger::StepCommand
- Debugger::VarClassVarCommand
- Debugger::VarInheritCommand
- Debugger::VarLocalCommand
- Debugger::WhereCommand
- Printers
- Printers::Base
- Printers::Base::MissedArgument
- Printers::Base::MissedPath
- Printers::Plain
- Mocha
- Mocha::Call
- Mocha::Expectation
- Mocha::Mock
- MiniTest
- MiniTest::Assertions
- MiniTest::Expectations
- TestDsl
- TestDsl::ClassMethods
- TestDsl::Shared
- Kernel
- Module
- PrinterHelpers
- TestInterface

No matching classes.

# Debugger::HelpCommand

Implements debugger "help" command.

### Public Class Methods

help(cmd) click to toggle source

    # File lib/ruby-debug/commands/help.rb, line 48
    def help(cmd)
      %{
        h[elp]\t\tprint this help
        h[elp] command\tprint help on command
      }
    end

help_command() click to toggle source

    # File lib/ruby-debug/commands/help.rb, line 44
    def help_command
      'help'
    end

### Public Instance Methods

execute() click to toggle source

    # File lib/ruby-debug/commands/help.rb, line 11
    def execute
      if @match[1]
        args = @match[1].split
        cmds = @state.commands.select do |cmd|
          [cmd.help_command].flatten.include?(args[0])
        end
      else
        args = @match[1]
        cmds = []
      end
      unless cmds.empty?
        help = cmds.map{ |cmd| cmd.help(args) }.join
        help = help.split("\n").map{|l| l.gsub(/^ +/, '')}
        help.shift if help.first && help.first.empty?
        help.pop if help.last && help.last.empty?
        print help.join("\n")
      else
        if args and args[0]
          errmsg "Undefined command: \"#{args[0]}\".  Try \"help\"."
        else
          print "ruby-debug help v#{Debugger::VERSION}\n" unless
            self.class.settings[:debuggertesting]
          print "Type 'help <command-name>' for help on a specific command\n\n"
          print "Available commands:\n"
          cmds = @state.commands.map{ |cmd| cmd.help_command }
          cmds = cmds.flatten.uniq.sort
          print columnize(cmds, self.class.settings[:width])
        end
      end
      print "\n"
    end

regexp() click to toggle source

    # File lib/ruby-debug/commands/help.rb, line 7
    def regexp
      /^\s* h(?:elp)? (?:\s+(.+))? $/
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.