Skip to content

Commit 23d6a68

Browse files
committed
Add limited delta stats after running
Signed-off-by: kadimitra <kadimitra@ece.auth.gr>
1 parent 6778882 commit 23d6a68

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/deltacode/cli.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ def print_version(ctx, param, value):
6363
click.echo('DeltaCode version ' + __version__)
6464
ctx.exit()
6565

66+
def print_summary(new,old,deltas_count):
67+
click.echo(click.style('Delta check done.', fg='green'))
68+
if deltas_count == 0:
69+
click.echo('Summary: The two codebases are identical.')
70+
else:
71+
click.echo('Summary: The two codebases differ.')
72+
click.echo('New file: {}'.format(new))
73+
click.echo('Old file: {}'.format(old))
74+
click.echo('Deltas count: {}'.format(deltas_count))
75+
click.echo(click.style('For more information check out the json file.', fg='green'))
6676

6777
@click.command()
6878
@click.help_option('-h', '--help')
@@ -91,3 +101,7 @@ def cli(new, old, json_file, all_delta_types):
91101

92102
# generate JSON output
93103
write_json(deltacode, json_file, all_delta_types)
104+
105+
# show limited delta status
106+
deltas_count = len([d for d in deltas(deltacode, all_delta_types)])
107+
print_summary(new,old,deltas_count)

0 commit comments

Comments
 (0)