From: W. Trevor King Date: Thu, 10 Jul 2014 19:01:17 +0000 (-0700) Subject: swc-windows-installer.py: Add --version and start with 0.1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=10682b9cbe179154106b33e897e2da5fcfbc1327;p=swc-workshop.git swc-windows-installer.py: Add --version and start with 0.1 Since we're decoupling these scripts (and any installers derived from them) from the per-workshop repository, it's good to have an easy way for folks to see which version they're dealing with. --- diff --git a/swc-windows-installer.py b/swc-windows-installer.py index 0e2077d..40fe336 100755 --- a/swc-windows-installer.py +++ b/swc-windows-installer.py @@ -41,6 +41,8 @@ except ImportError: # Python 2 import zipfile +__version__ = '0.1' + LOG = logging.getLogger('swc-windows-installer') LOG.addHandler(logging.StreamHandler()) LOG.setLevel(logging.INFO) @@ -282,6 +284,9 @@ if __name__ == '__main__': choices=['critical', 'error', 'warning', 'info', 'debug'], help='Verbosity (defaults to {!r})'.format( logging.getLevelName(LOG.level).lower())) + parser.add_argument( + '--version', action='version', + version='%(prog)s {}'.format(__version__)) args = parser.parse_args() @@ -290,5 +295,6 @@ if __name__ == '__main__': LOG.setLevel(level) LOG.info('Preparing your Software Carpentry awesomeness!') + LOG.info('installer version {}'.format(__version__)) main() LOG.info('Installation complete.')