suppress empty dict printing when no duplicates found

This commit is contained in:
darko-poljak 2014-01-27 13:20:25 +01:00
parent 42202b901b
commit 30620884c9

View file

@ -133,7 +133,9 @@ def main():
if action == 'print': if action == 'print':
dups = file_dups(topdirs, args['--digest-alg'], args['--block-size']) dups = file_dups(topdirs, args['--digest-alg'], args['--block-size'])
print(json.dumps(dict(dups), indent=4)) spam = dict(dups)
if spam:
print(json.dumps(spam, indent=4))
elif action == 'move': elif action == 'move':
mv_file_dups(topdirs, args['--digest-alg'], args['--block-size'], mv_file_dups(topdirs, args['--digest-alg'], args['--block-size'],
args['--move']) args['--move'])