Skip to content

Commit

Permalink
Colorize 'bosh diff' output
Browse files Browse the repository at this point in the history
Change-Id: I7f44a933a45f06640a8f37ea54d95d43227ab15d
  • Loading branch information
olegshaldybin committed May 4, 2012
1 parent 5ff0682 commit 7cc9f2f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cli/lib/cli/commands/biff.rb
Expand Up @@ -73,7 +73,19 @@ def print_string_diff(str1, str2)
output = "No differences."
@no_differences = true
end
say(output)

output.each_line do |line|
added = line[0..0] == "+"
removed = line[0..0] == "-"

if added
say(line.chomp.green)
elsif removed
say(line.chomp.red)
else
say(line)
end
end
end

# Alias for find. It is used to find within a given object, not the default
Expand Down

0 comments on commit 7cc9f2f

Please sign in to comment.