diff --git a/imgrate.py b/imgrate.py index 0ea5d90..ec8fdc5 100755 --- a/imgrate.py +++ b/imgrate.py @@ -55,6 +55,7 @@ if __name__ == '__main__': ap = ArgumentParser() ap.add_argument('images', type=str, nargs='+', help='') ap.add_argument('-d', '--delete', action='store_true', help='Delete all but the best quality image.') + ap.add_argument('-q', '--quiet', action='store_true', help='Print quality measurements only.') return ap.parse_args() @@ -63,8 +64,11 @@ if __name__ == '__main__': maximum = max(ratings, key=ratings.get) for rating in ratings.keys(): - maxmark = '*' if rating == maximum and len(ratings) > 1 else ' ' - print('{}imgrate("{}") = {}'.format(maxmark, rating, ratings[rating])) + if args.quiet: + print(ratings[rating]) + else: + maxmark = '*' if rating == maximum and len(ratings) > 1 else ' ' + print('{}imgrate("{}") = {}'.format(maxmark, rating, ratings[rating])) if args.delete: [remove(image) for image in ratings if image != maximum]