Permalink
Browse files

Merge "Colorize 'bosh diff' output"

  • Loading branch information...
2 parents 63fa64b + 7cc9f2f commit 32064d34b2a459e5c60fddb35dce317385c89927 @olegshaldybin olegshaldybin committed with Gerrit Code Review May 4, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 cli/lib/cli/commands/biff.rb
@@ -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

0 comments on commit 32064d3

Please sign in to comment.