From 56ad0a141fb31c3292f95c13863df79bf2435205 Mon Sep 17 00:00:00 2001 From: Alexander Vasarab Date: Tue, 30 Jun 2020 18:07:52 -0700 Subject: [PATCH 1/1] Implement --version switch --- infoex-autowx.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/infoex-autowx.py b/infoex-autowx.py index 78c4d49..442376b 100755 --- a/infoex-autowx.py +++ b/infoex-autowx.py @@ -42,6 +42,8 @@ import zeep import zeep.cache import zeep.transports +__version__ = '2.0.0' + log = logging.getLogger(__name__) log.setLevel(logging.DEBUG) @@ -69,10 +71,20 @@ parser.add_option("--dry-run", default=False, help="fetch data but don't upload to InfoEx") +parser.add_option("--version", + action="store_true", + dest="show_version", + default=False, + help="show program version and exit") + (options, args) = parser.parse_args() config = configparser.ConfigParser(allow_no_value=False) +if options.show_version: + print("%s - %s" % (os.path.basename(__file__), __version__)) + sys.exit(0) + if not options.config: print("Please specify a configuration file via --config.") sys.exit(1) -- 2.30.2