Class: Byebug::HistoryCommand
Overview
Show history of byebug commands.
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match
Class Method Details
.description ⇒ Object
29
30
31
|
# File 'lib/byebug/commands/history.rb', line 29
def description
%(hist[ory] [num_cmds] Show byebug's command history.)
end
|
.names ⇒ Object
25
26
27
|
# File 'lib/byebug/commands/history.rb', line 25
def names
%w(history)
end
|
Instance Method Details
#execute ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/byebug/commands/history.rb', line 10
def execute
unless Setting[:autosave]
return errmsg('Not currently saving history. ' \
"Enable it with \"set autosave\"")
end
if @match[:num_cmds]
size, err = get_int(@match[:num_cmds], 'history', 1, Setting[:histsize])
return errmsg(err) unless size
end
puts History.to_s(size || Setting[:histsize])
end
|
#regexp ⇒ Object
6
7
8
|
# File 'lib/byebug/commands/history.rb', line 6
def regexp
/^\s* hist(?:ory)? (?:\s+(?<num_cmds>.+))? \s*$/x
end
|