Commit f678007b authored by Pierre Augier's avatar Pierre Augier
Browse files

--version

parent 5ab2e8cf23aa
...@@ -7,6 +7,7 @@ import argparse ...@@ -7,6 +7,7 @@ import argparse
from pathlib import Path from pathlib import Path
from glob import glob from glob import glob
from . import __version__
from .files_maker import create_pythran_files from .files_maker import create_pythran_files
from .log import logger, set_log_level from .log import logger, set_log_level
...@@ -29,6 +30,13 @@ def parse_args(): ...@@ -29,6 +30,13 @@ def parse_args():
action="store_true", action="store_true",
) )
parser.add_argument(
"-V",
"--version",
help="print version and exit",
action="store_true",
)
parser.add_argument("-v", "--verbose", help="verbose mode", action="count") parser.add_argument("-v", "--verbose", help="verbose mode", action="count")
return parser.parse_args() return parser.parse_args()
...@@ -37,6 +45,10 @@ def parse_args(): ...@@ -37,6 +45,10 @@ def parse_args():
def run(): def run():
args = parse_args() args = parse_args()
if args.version:
print(__version__)
return
if args.verbose is None: if args.verbose is None:
set_log_level("info") set_log_level("info")
elif args.verbose > 0: elif args.verbose > 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment