class Byebug::HistoryCommand - byebug-4.0.5 Documentation

# class Byebug::HistoryCommand

Show history of byebug commands.

### Public Class Methods

description() click to toggle source

    # File lib/byebug/commands/history.rb, line 28
    def description
      prettify <<-EOD
        hist[ory] [num_cmds]        Show byebug's command history.
      EOD
    end

names() click to toggle source

    # File lib/byebug/commands/history.rb, line 24
    def names
      %w(history)
    end

### Public Instance Methods

execute() click to toggle source

    # File lib/byebug/commands/history.rb, line 12
    def execute
      history = @state.interface.history

      if @match[:num_cmds]
        size, _ = get_int(@match[:num_cmds], 'history', 1, history.size)
        return errmsg(err) unless size
      end

      puts history.to_s(size)
    end

regexp() click to toggle source

    # File lib/byebug/commands/history.rb, line 8
    def regexp
      /^\s* hist(?:ory)? (?:\s+(?<num_cmds>.+))? \s*$/x
    end