Skip to content

Commit

Permalink
add a --version option
Browse files Browse the repository at this point in the history
  • Loading branch information
marksidell committed Feb 23, 2020
1 parent ff4c3fa commit 754ef58
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
5 changes: 4 additions & 1 deletion alohomora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
except NameError:
pass

__version__ = '2.3.0'
__version__ = '2.4.0'
__author__ = 'Stephan Kemper'
__author_email__ = '[email protected]'
__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):
Expand Down
10 changes: 10 additions & 0 deletions alohomora/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'))

Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@
name='alohomora',
version=alohomora.__version__,
author=alohomora.__author__,
author_email='[email protected]',
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",
Expand Down

0 comments on commit 754ef58

Please sign in to comment.