File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -114,13 +114,23 @@ def run(argv):
114
114
exclude_list = get_tables_argument_list (args .exclude )
115
115
116
116
# flip logic of the command line flag for multi process
117
- # optimizations for use as a u_diff function argument
117
+ # optimization use
118
118
use_mp = not args .nomp
119
119
120
120
if args .external :
121
121
# ------------------------------
122
122
# External executable tool diff
123
123
# ------------------------------
124
+ # head and tail are not supported when external diff tool is called
125
+ if args .head or args .tail :
126
+ sys .stderr .write (f"[ERROR] The head and tail options are not supported with external diff executable calls.{ os .linesep } " )
127
+ sys .exit (1 )
128
+
129
+ # lines of context filter is not supported when external diff tool is called
130
+ if args .lines != 3 :
131
+ sys .stderr .write (f"[ERROR] The lines option is not supported with external diff executable calls.{ os .linesep } " )
132
+ sys .exit (1 )
133
+
124
134
try :
125
135
diff = external_diff (
126
136
args .external ,
@@ -133,8 +143,11 @@ def run(argv):
133
143
134
144
# write stdout from external tool
135
145
for line , exit_code in diff :
136
- # if exit_code is None:
137
- sys .stdout .write (line )
146
+ # format with color if color flag is entered on command line
147
+ if args .color :
148
+ sys .stdout .write (color_unified_diff_line (line ))
149
+ else :
150
+ sys .stdout .write (line )
138
151
if exit_code is not None :
139
152
sys .exit (exit_code )
140
153
except Exception as e :
You can’t perform that action at this time.
0 commit comments