mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Make --diff colours configurable
This commit is contained in:
@@ -138,12 +138,12 @@ class CallbackBase:
|
||||
has_diff = False
|
||||
for line in differ:
|
||||
has_diff = True
|
||||
if line.startswith('-'):
|
||||
line = stringc(line, 'red')
|
||||
elif line.startswith('+'):
|
||||
line = stringc(line, 'green')
|
||||
if line.startswith('+'):
|
||||
line = stringc(line, C.COLOR_DIFF_ADD)
|
||||
elif line.startswith('-'):
|
||||
line = stringc(line, C.COLOR_DIFF_REMOVE)
|
||||
elif line.startswith('@@'):
|
||||
line = stringc(line, 'cyan')
|
||||
line = stringc(line, C.COLOR_DIFF_LINES)
|
||||
ret.append(line)
|
||||
if has_diff:
|
||||
ret.append('\n')
|
||||
|
||||
Reference in New Issue
Block a user