From 4f88a1b4d9cc65386d15fca80d6c9eb70e740548 Mon Sep 17 00:00:00 2001 From: Simeon Widdis Date: Thu, 6 Jul 2023 09:54:54 -0700 Subject: [PATCH] Add colored diff output to diff Signed-off-by: Simeon Widdis --- cli/src/diff/diff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/diff/diff.py b/cli/src/diff/diff.py index 3157627..65ef24e 100644 --- a/cli/src/diff/diff.py +++ b/cli/src/diff/diff.py @@ -111,9 +111,9 @@ def output_diff(difference: dict[str, object], prefix: str = "") -> None: if "expected" not in value and "actual" not in value: output_diff(value, f"{prefix}{key}.") if value.get("actual") is not None: - click.echo(f"- {out_key}: {json.dumps(value.get('actual'))}") + click.secho(f"- {out_key}: {json.dumps(value.get('actual'))}", fg="red") if value.get("expected") is not None: - click.echo(f"+ {out_key}: {json.dumps(value.get('expected'))}") + click.secho(f"+ {out_key}: {json.dumps(value.get('expected'))}", fg="green") @click.command()