diff --git a/alohomora/__init__.py b/alohomora/__init__.py index 6f20e90..5d297cc 100644 --- a/alohomora/__init__.py +++ b/alohomora/__init__.py @@ -23,9 +23,12 @@ except NameError: pass -__version__ = '2.3.0' +__version__ = '2.4.0' __author__ = 'Stephan Kemper' +__author_email__ = 'vice-support@viasat.com' __license__ = '(c) 2020 Viasat, Inc. See the LICENSE file for more details.' +__url__ = 'https://github.com/Viasat/alohomora' +__description__ = 'Get AWS API keys for a SAML-federated identity' def die(msg): diff --git a/alohomora/main.py b/alohomora/main.py index 3bf5a13..3a4b866 100755 --- a/alohomora/main.py +++ b/alohomora/main.py @@ -125,6 +125,10 @@ def __init__(self): action='store_true', help="Set the log level to debug", default=False) + parser.add_argument("--version", + action='store_true', + help="Print the program version and exit", + default=False) self.options = parser.parse_args() # if debug is passed, set log level to DEBUG @@ -145,6 +149,12 @@ def __init__(self): def main(self): """Run the program.""" + if self.options.version: + print('Version:', alohomora.__version__) + print('Python: ', sys.version.replace('\n', ' ').replace('\r', '')) + print('README: ', alohomora.__url__) + return + # Validate options duration = to_seconds(self._get_config('duration', '1h')) diff --git a/setup.py b/setup.py index 04d27fb..369c360 100644 --- a/setup.py +++ b/setup.py @@ -20,16 +20,17 @@ name='alohomora', version=alohomora.__version__, author=alohomora.__author__, - author_email='vice@viasat.com', + author_email=alohomora.__author_email__, + license=alohomora.__license__, + url=alohomora.__url__, + description=alohomora.__description__, + packages=['alohomora'], entry_points={ "console_scripts": [ "alohomora=alohomora.main:main", ], }, - url='https://github.com/Viasat/alohomora', - license=alohomora.__license__, - description="Get AWS API keys for a SAML-federated identity", install_requires=[ "boto3>=1.3.1", "beautifulsoup4>=4.5.1",