提交 f22089ac 编写于 作者: B Behdad Esfahbod

Misc fixes

上级 96968bfa
......@@ -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)
f1, f2 = (open_file_or_stdin (f) for f in sys.argv[1:3])
files = (FileHelpers.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 = []):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册