Misc fixes
This commit is contained in:
parent
96968bfae5
commit
f22089ac24
|
@ -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)
|
||||
|
|
|
@ -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 = []):
|
||||
|
|
Loading…
Reference in New Issue