From 51172e5befd4b1d1e3891440c10bd1f4e6885e8a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 9 Jan 2013 11:01:17 -0500 Subject: [PATCH] main: Add an explicit --version argument. Use an explicit `version` action instead of the undocumented (and deprecated) `version` keyword to ArgumentParser [1,2]. [1]: http://docs.python.org/3.3/library/argparse.html#action [2]: http://docs.python.org/3.3/library/argparse.html#upgrading-optparse-code Signed-off-by: W. Trevor King --- rss2email/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rss2email/main.py b/rss2email/main.py index 5609b51..47817fe 100644 --- a/rss2email/main.py +++ b/rss2email/main.py @@ -20,8 +20,11 @@ def run(*args, **kwargs): `.parse_args()` call without modification. """ parser = _argparse.ArgumentParser( - description=_PACKAGE_DOCSTRING, version=__version__) + prog='rss2email', description=_PACKAGE_DOCSTRING) + parser.add_argument( + '-v', '--version', action='version', + version='%(prog)s {}'.format(__version__)) parser.add_argument( '-c', '--config', metavar='PATH', default=[], action='append', help='path to the configuration file') -- 2.26.2