Skip to content

Commit e0f6000

Browse files
committed
Added a cli arguments which will be displayed after the deltas are compared in the form of key and value pairs
Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com> added delta stats to the cli and the output is displayed in the form of key and value pairs Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com> added the line break in configure file and produced the output in the CLI in the form of key value pair Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com>
1 parent 6778882 commit e0f6000

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/deltacode/cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ def write_json(deltacode, outfile, all_delta_types=False):
5151
('delta_stats', deltacode.stats.to_dict()),
5252
('deltas', deltas(deltacode, all_delta_types))
5353
])
54-
54+
click.secho(get_notice(),fg="green")
55+
click.echo('deltas_count: {}'.format(len([d for d in deltas(deltacode, all_delta_types)])))
56+
click.echo('delta_stats: ')
57+
for stat in deltacode.stats.to_dict():
58+
click.echo(""" "{}": {}""".format(str(stat),deltacode.stats.to_dict()[stat]))
5559
# TODO: add toggle for pretty printing
5660
simplejson.dump(results, outfile, iterable_as_array=True, indent=2)
5761
outfile.write('\n')
5862

59-
6063
def print_version(ctx, param, value):
6164
if not value or ctx.resilient_parsing:
6265
return

src/deltacode/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ def get_notice():
275275
delimiter = '\n\n\n'
276276
[notice_text, extra_notice_text] = notice_text.split(delimiter, 1)
277277
extra_notice_text = delimiter + extra_notice_text
278-
279-
delimiter = '\n\n '
278+
279+
delimiter = '\n\n '
280280
[notice_text, acknowledgment_text] = notice_text.split(delimiter, 1)
281281
acknowledgment_text = delimiter + acknowledgment_text
282282

0 commit comments

Comments
 (0)