Misc fixes

This commit is contained in:
Behdad Esfahbod 2012-01-20 21:21:47 -05:00
parent 96968bfae5
commit f22089ac24
2 changed files with 6 additions and 6 deletions

View File

@ -3,12 +3,12 @@
from hb_test_tools import *
import sys, os
colors, sys.argv = Colors.Auto (sys.argv)
if len (sys.argv) != 3:
print "usage: %s [--color] file1 file2" % sys.argv[0]
sys.exit (1)
colors = Colors.Auto (sys.argv)
files = (FileHelpers.open_file_or_stdin (f) for f in sys.argv[1:3])
f1, f2 = (open_file_or_stdin (f) for f in sys.argv[1:3])
FancyDiffer.diff_files (f1, f2, colors=colors)
FancyDiffer.diff_files (*files, colors=colors)

View File

@ -21,9 +21,9 @@ class Colors:
if "--color" in argv or os.isatty (out.fileno ()):
if "--color" in sys.argv[1:]:
argv.remove ("--color")
return Colors.ANSI
return Colors.ANSI, argv
else:
return Colors.Null
return Colors.Null, argv
@staticmethod
def Default (argv = []):