Skip to content

Commit

Permalink
print pycodestyle version info
Browse files Browse the repository at this point in the history
  • Loading branch information
Hideo Hattori committed Feb 24, 2017
1 parent 7144154 commit ba5eb08
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion autopep8.py
Expand Up @@ -3155,6 +3155,11 @@ def extract_code_from_function(function):
return code


def _get_package_version():
packages = ["pycodestyle: {0}".format(pycodestyle.__version__)]
return ", ".join(packages)


def create_parser():
"""Return command-line parser."""
# Do import locally to be friendly to those who use autopep8 as a library
Expand All @@ -3164,7 +3169,8 @@ def create_parser():
parser = argparse.ArgumentParser(description=docstring_summary(__doc__),
prog='autopep8')
parser.add_argument('--version', action='version',
version='%(prog)s ' + __version__)
version='%(prog)s {0} ({1})'.format(
__version__, _get_package_version()))
parser.add_argument('-v', '--verbose', action='count',
default=0,
help='print verbose messages; '
Expand Down

0 comments on commit ba5eb08

Please sign in to comment.