diff --git a/src/griffe/__init__.py b/src/griffe/__init__.py index 76e1ffc3..603b0715 100644 --- a/src/griffe/__init__.py +++ b/src/griffe/__init__.py @@ -16,6 +16,8 @@ from griffe.loader import load from griffe.logger import get_logger +__version__ = "0.32.3" + __all__: list[str] = [ "Attribute", "Class", diff --git a/src/griffe/cli.py b/src/griffe/cli.py index bb195408..e630807f 100644 --- a/src/griffe/cli.py +++ b/src/griffe/cli.py @@ -24,6 +24,7 @@ import colorama +from griffe import __version__ from griffe.diff import ExplanationStyle, find_breaking_changes from griffe.docstrings.parsers import Parser from griffe.encoders import JSONEncoder @@ -122,6 +123,7 @@ def get_parser() -> argparse.ArgumentParser: global_options = parser.add_argument_group(title="Global options") global_options.add_argument("-h", "--help", action="help", help=main_help) + global_options.add_argument("-V", "--version", action="version", version=f'%(prog)s ' + __version__) def add_common_options(subparser: argparse.ArgumentParser) -> None: common_options = subparser.add_argument_group(title="Common options")