mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Make --diff lines of context configurable
This commit is contained in:
@@ -284,6 +284,9 @@ COLOR_DIFF_ADD = get_config(p, 'colors', 'diff_add', 'ANSIBLE_COLOR_DIFF_ADD'
|
|||||||
COLOR_DIFF_REMOVE = get_config(p, 'colors', 'diff_remove', 'ANSIBLE_COLOR_DIFF_REMOVE', 'red')
|
COLOR_DIFF_REMOVE = get_config(p, 'colors', 'diff_remove', 'ANSIBLE_COLOR_DIFF_REMOVE', 'red')
|
||||||
COLOR_DIFF_LINES = get_config(p, 'colors', 'diff_lines', 'ANSIBLE_COLOR_DIFF_LINES', 'cyan')
|
COLOR_DIFF_LINES = get_config(p, 'colors', 'diff_lines', 'ANSIBLE_COLOR_DIFF_LINES', 'cyan')
|
||||||
|
|
||||||
|
# diff
|
||||||
|
DIFF_CONTEXT = get_config(p, 'diff', 'context', 'ANSIBLE_DIFF_CONTEXT', 3, integer=True)
|
||||||
|
|
||||||
# non-configurable things
|
# non-configurable things
|
||||||
MODULE_REQUIRE_ARGS = ['command', 'shell', 'raw', 'script']
|
MODULE_REQUIRE_ARGS = ['command', 'shell', 'raw', 'script']
|
||||||
MODULE_NO_JSON = ['command', 'shell', 'raw']
|
MODULE_NO_JSON = ['command', 'shell', 'raw']
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class CallbackBase:
|
|||||||
tofile=after_header,
|
tofile=after_header,
|
||||||
fromfiledate='',
|
fromfiledate='',
|
||||||
tofiledate='',
|
tofiledate='',
|
||||||
n=10)
|
n=C.DIFF_CONTEXT)
|
||||||
has_diff = False
|
has_diff = False
|
||||||
for line in differ:
|
for line in differ:
|
||||||
has_diff = True
|
has_diff = True
|
||||||
|
|||||||
Reference in New Issue
Block a user