Skip to content

Commit

Permalink
Add --version flag
Browse files Browse the repository at this point in the history
Outputs version information about module, Boto3/botocore, and Python.

Closes NetSPI#5.
  • Loading branch information
aph3rson committed May 7, 2020
1 parent cbd9901 commit 9a133bf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions aws_consoler/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import webbrowser
import logging
import pkg_resources
from requests.exceptions import HTTPError

from aws_consoler.logic import run
Expand Down Expand Up @@ -74,6 +75,15 @@ def main(argv=sys.argv[1:]):
"-v", "--verbose", action="count",
help="Verbosity, repeat for more verbose output (up to 3)")
logger.debug("General group ready.")
gen_grp.add_argument(
"-V", "--version", action="version",
version="aws_consoler/{} boto3/{} botocore/{} Python/{}".format(
pkg_resources.get_distribution("aws_consoler").version,
pkg_resources.get_distribution("boto3").version,
pkg_resources.get_distribution("botocore").version,
sys.version
)
)

adv_grp = parser.add_argument_group(title="Advanced arguments")
adv_grp.add_argument(
Expand Down

0 comments on commit 9a133bf

Please sign in to comment.