From c0620537c54334f569c315d22684c1cfbcf2612a Mon Sep 17 00:00:00 2001 From: Anton Rieder Date: Tue, 17 Feb 2015 14:11:25 +0100 Subject: [PATCH] Add --version, remove trailing spaces in help texts --- pidcat.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pidcat.py b/pidcat.py index c275313..940dc8d 100755 --- a/pidcat.py +++ b/pidcat.py @@ -27,6 +27,8 @@ import re import subprocess from subprocess import PIPE +__version__ = '1.4.1' + LOG_LEVELS = 'VDIWEF' LOG_LEVELS_MAP = dict([(LOG_LEVELS[i], i) for i in range(len(LOG_LEVELS))]) parser = argparse.ArgumentParser(description='Filter logcat by package name') @@ -36,11 +38,12 @@ parser.add_argument('-l', '--min-level', dest='min_level', type=str, choices=LOG parser.add_argument('--color-gc', dest='color_gc', action='store_true', help='Color garbage collection') parser.add_argument('--always-display-tags', dest='always_tags', action='store_true',help='Always display the tag name') parser.add_argument('-s', '--serial', dest='device_serial', help='Device serial number (adb -s option)') -parser.add_argument('-d', '--device', dest='use_device', action='store_true', help='Use first device for log input (adb -d option).') -parser.add_argument('-e', '--emulator', dest='use_emulator', action='store_true', help='Use first emulator for log input (adb -e option).') -parser.add_argument('-c', '--clear', dest='clear_logcat', action='store_true', help='Clear the entire log before running.') +parser.add_argument('-d', '--device', dest='use_device', action='store_true', help='Use first device for log input (adb -d option)') +parser.add_argument('-e', '--emulator', dest='use_emulator', action='store_true', help='Use first emulator for log input (adb -e option)') +parser.add_argument('-c', '--clear', dest='clear_logcat', action='store_true', help='Clear the entire log before running') parser.add_argument('-t', '--tag', dest='tag', action='append', help='Filter output by specified tag(s)') parser.add_argument('-i', '--ignore-tag', dest='ignored_tag', action='append', help='Filter output by ignoring specified tag(s)') +parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__, help='Print the version number and exit') args = parser.parse_args() min_level = LOG_LEVELS_MAP[args.min_level.upper()]