Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

+ Added -p (plain diff) and made -u (unified diff) the default for un…

…it_diff

[git-p4: depot-paths = "//src/ZenTest/dev/": change = 6303]
  • Loading branch information...
commit 8636d18941c3accd3b06075cd008879f4ca3cd5f 1 parent a38ca41
Ryan Davis authored
3  bin/unit_diff
@@ -10,7 +10,8 @@
10 10
 #    -c contextual diff
11 11
 #    -h show usage
12 12
 #    -k keep temp diff files around
13  
-#    -u unified diff
  13
+#    -u unified diff [default]
  14
+#    -p plain diff
14 15
 #    -v display version
15 16
 
16 17
 require 'unit_diff'
8  lib/unit_diff.rb
@@ -33,7 +33,8 @@
33 33
 #     -h show usage
34 34
 #     -k keep temp diff files around
35 35
 #     -l prefix line numbers on the diffs
36  
-#     -u unified diff
  36
+#     -u unified diff [default]
  37
+#     -p plain diff
37 38
 #     -v display version
38 39
 
39 40
 class UnitDiff
@@ -193,7 +194,8 @@ def unit_diff(input=ARGF, output=$stdout)
193 194
     $b = false unless defined? $b
194 195
     $c = false unless defined? $c
195 196
     $k = false unless defined? $k
196  
-    $u = false unless defined? $u
  197
+    $u = true  unless defined? $u
  198
+    $p = false unless defined? $p
197 199
 
198 200
     data, footer = self.parse_input(input, output)
199 201
 
@@ -241,7 +243,7 @@ def diff expect, butwas
241 243
         b.write(massage(butwas))
242 244
         b.rewind
243 245
 
244  
-        diff_flags = $u ? "-u" : $c ? "-c" : ""
  246
+        diff_flags = $p ? "" : $c ? "-c" : "-u"
245 247
         diff_flags += " -b" if $b
246 248
 
247 249
         result = `#{DIFF} #{diff_flags} #{a.path} #{b.path}`

0 notes on commit 8636d18

Please sign in to comment.
Something went wrong with that request. Please try again.