mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Pass hist commands through stagger_output.
This commit is contained in:
parent
fc31bb2926
commit
7815897507
1 changed files with 8 additions and 4 deletions
|
@ -25,20 +25,24 @@ class Pry
|
||||||
pattern = Regexp.new opts[:arg_string].split(/ /)[1]
|
pattern = Regexp.new opts[:arg_string].split(/ /)[1]
|
||||||
history.pop
|
history.pop
|
||||||
|
|
||||||
history.each_with_index do |element, index|
|
history.map!.with_index do |element, index|
|
||||||
if element =~ pattern
|
if element =~ pattern
|
||||||
output.puts "#{text.blue index}: #{element}"
|
"#{text.blue index}: #{element}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
stagger_output history.compact.join "\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
opt.on :e, :exclude, 'Exclude pry and system commands from the history.' do
|
opt.on :e, :exclude, 'Exclude pry and system commands from the history.' do
|
||||||
unless opt.grep?
|
unless opt.grep?
|
||||||
history.each_with_index do |element, index|
|
history.map!.with_index do |element, index|
|
||||||
unless command_processor.valid_command? element
|
unless command_processor.valid_command? element
|
||||||
output.puts "#{text.blue index}: #{element}"
|
"#{text.blue index}: #{element}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
stagger_output history.compact.join "\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue