Skip to content

Commit 5ce223c

Browse files
committed
[__main__] refactor variable name to make definition more explicit
1 parent 16d48c0 commit 5ce223c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/fdiff/__main__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,17 @@ def run(argv):
144144
iterable = diff
145145

146146
# print unified diff results to standard output stream
147-
# TODO: add support for text output to indicate that there was no diff found
148-
# TODO: ( see https://stackoverflow.com/a/661967 )
149-
has_output = False
147+
has_diff = False
150148
if args.color:
151149
for line in iterable:
152-
has_output = True
150+
has_diff = True
153151
sys.stdout.write(color_unified_diff_line(line))
154152
else:
155153
for line in iterable:
156-
has_output = True
154+
has_diff = True
157155
sys.stdout.write(line)
158156

159-
if not has_output:
157+
# if no difference was found, tell the user instead of
158+
# simply closing with zero exit status code.
159+
if not has_diff:
160160
print("[*] There is no difference between the files.")

0 commit comments

Comments
 (0)