Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e47119d commit a750606Copy full SHA for a750606
1 file changed
pre_commit/main.py
@@ -1,6 +1,7 @@
1
from __future__ import unicode_literals
2
3
import argparse
4
+import pkg_resources
5
6
from pre_commit import color
7
from pre_commit.commands.autoupdate import autoupdate
@@ -16,6 +17,15 @@
16
17
def main(argv):
18
parser = argparse.ArgumentParser()
19
20
+ # http://stackoverflow.com/a/8521644/812183
21
+ parser.add_argument(
22
+ '-V', '--version',
23
+ action='version',
24
+ version='%(prog)s {0}'.format(
25
+ pkg_resources.get_distribution('pre-commit').version
26
+ )
27
28
+
29
subparsers = parser.add_subparsers(dest='command')
30
31
subparsers.add_parser('install', help='Intall the pre-commit script.')
0 commit comments