Skip to content

Commit c91657e

Browse files
authored
add -V/--version CLI option (#344)
1 parent 784d042 commit c91657e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyperformance/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os.path
44
import sys
55

6-
from pyperformance import _utils, is_installed, is_dev
6+
from pyperformance import _utils, is_installed, is_dev, __version__
77
from pyperformance.commands import (
88
cmd_list,
99
cmd_list_groups,
@@ -40,8 +40,11 @@ def filter_opts(cmd, *, allow_no_benchmarks=False):
4040

4141
def parse_args():
4242
parser = argparse.ArgumentParser(
43+
prog='pyperformance',
4344
description=("Compares the performance of baseline_python with"
4445
" changed_python and prints a report."))
46+
parser.add_argument('-V', '--version', action='version',
47+
version=f'%(prog)s {__version__}')
4548

4649
subparsers = parser.add_subparsers(dest='action')
4750
cmds = []

0 commit comments

Comments
 (0)