Skip to content

Commit

Permalink
Make no-color output consistent with color output
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Apr 28, 2012
1 parent 4e84e4d commit 0be1daa
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 331 deletions.
6 changes: 5 additions & 1 deletion lib/t/printable.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def print_statuses(statuses)
end end
print_table(array) print_table(array)
else else
ENV['THOR_COLUMNS'] = "80"
if STDOUT.tty? && !options['no-color'] if STDOUT.tty? && !options['no-color']
statuses.each do |status| statuses.each do |status|
say(" #{Thor::Shell::Color::BOLD}@#{status.user.screen_name}", :yellow) say(" #{Thor::Shell::Color::BOLD}@#{status.user.screen_name}", :yellow)
Expand All @@ -89,7 +90,10 @@ def print_statuses(statuses)
end end
else else
statuses.each do |status| statuses.each do |status|
say "#{status.user.screen_name.rjust(MAX_SCREEN_NAME_SIZE)}: #{status.text.gsub(/\n+/, ' ')} (#{time_ago_in_words(status.created_at)} ago)" say(" @#{status.user.screen_name}")
Thor::Shell::Basic.new.print_wrapped(status.text, :indent => 3)
say(" #{time_ago_in_words(status.created_at)} ago")
say
end end
end end
end end
Expand Down
Loading

0 comments on commit 0be1daa

Please sign in to comment.