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
1 changed files with 3 additions and 1 deletions

View File

@ -133,7 +133,9 @@ def main():
if action == 'print':
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':
mv_file_dups(topdirs, args['--digest-alg'], args['--block-size'],
args['--move'])