class Byebug::HistoryCommand

Show history of byebug commands.

Public Class Methods

description() click to toggle source
# File lib/byebug/commands/history.rb, line 17
def self.description
  <<-EOD
    hist[ory] [num_cmds]

    #{short_description}
  EOD
end
regexp() click to toggle source
# File lib/byebug/commands/history.rb, line 13
def self.regexp
  /^\s* hist(?:ory)? (?:\s+(?<num_cmds>.+))? \s*$/x
end
short_description() click to toggle source
# File lib/byebug/commands/history.rb, line 25
def self.short_description
  "Shows byebug's history of commands"
end

Public Instance Methods

execute() click to toggle source
# File lib/byebug/commands/history.rb, line 29
def execute
  history = processor.interface.history

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

  puts history.to_s(size)
end