Pass hist commands through stagger_output.

This commit is contained in:
Rob Gleeson 2011-05-10 13:21:17 +01:00
parent fc31bb2926
commit 7815897507
1 changed files with 8 additions and 4 deletions

View File

@ -25,20 +25,24 @@ class Pry
pattern = Regexp.new opts[:arg_string].split(/ /)[1]
history.pop
history.each_with_index do |element, index|
history.map!.with_index do |element, index|
if element =~ pattern
output.puts "#{text.blue index}: #{element}"
"#{text.blue index}: #{element}"
end
end
stagger_output history.compact.join "\n"
end
opt.on :e, :exclude, 'Exclude pry and system commands from the history.' do
unless opt.grep?
history.each_with_index do |element, index|
history.map!.with_index do |element, index|
unless command_processor.valid_command? element
output.puts "#{text.blue index}: #{element}"
"#{text.blue index}: #{element}"
end
end
stagger_output history.compact.join "\n"
end
end