def print_statuses(statuses, sort = true, time_format = nil)
return unless statuses and statuses.first
unless time_format
t0 = Time.now
t1 = Time.parse(statuses.first[:created_at])
t2 = Time.parse(statuses.last[:created_at])
time_format =
if [t0.year, t0.month, t0.day] == [t1.year, t1.month, t1.day] \
and [t1.year, t1.month, t1.day] == [t2.year, t2.month, t2.day]
'%H:%M:%S'
else
'%y/%m/%d %H:%M'
end
end
output_text = ''
statuses.each do |s|
output_text << status_line(s, time_format)
end
if config.plugins.stdout.enable_pager && ENV['LINES'] && statuses.size > ENV['LINES'].to_i
file = Tempfile.new('termtter')
file.print output_text
file.close
system "#{config.plugins.stdout.pager} #{file.path}"
file.close(true)
else
print output_text
end
end