mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
Fix human-readable console output for --all
This commit is contained in:
parent
8726e38fac
commit
f9fc5d982e
1 changed files with 14 additions and 2 deletions
|
@ -140,6 +140,18 @@ def cmp() -> None:
|
|||
else:
|
||||
from .lib.nicelogger import Colors, support_color
|
||||
c = Colors(support_color(sys.stdout))
|
||||
arrow = f'{c.red}<-{c.normal}' if diff.get('delta', None) == 'old' else '->'
|
||||
|
||||
[print(f'{diff["name"]} {c.red}{diff["oldver"]}{c.normal} {arrow} {c.green}{diff["newver"]}{c.normal}') for diff in differences]
|
||||
for diff in differences:
|
||||
delta = diff.get('delta', None)
|
||||
|
||||
if delta == 'new':
|
||||
arrow = '->'
|
||||
oldc = c.red
|
||||
elif delta == 'old':
|
||||
arrow = f'{c.red}<-{c.normal}'
|
||||
oldc = c.red
|
||||
else:
|
||||
arrow = '=='
|
||||
oldc = c.green
|
||||
|
||||
print(f'{diff["name"]} {oldc}{diff["oldver"]}{c.normal} {arrow} {c.green}{diff["newver"]}{c.normal}')
|
||||
|
|
Loading…
Add table
Reference in a new issue