From f0c394a8b9ed44ef9830ac3a7b2d13df2f60f084 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Mon, 12 Aug 2024 19:21:50 +0300 Subject: [PATCH] Stubgen add `--version` (#17662) --- mypy/stubgen.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mypy/stubgen.py b/mypy/stubgen.py index 4e6e3efc000b..f4a418838161 100755 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -54,6 +54,7 @@ import mypy.parse import mypy.traverser import mypy.util +import mypy.version from mypy.build import build from mypy.errors import CompileError, Errors from mypy.find_sources import InvalidSourceList, create_source_list @@ -1847,6 +1848,9 @@ def parse_options(args: list[str]) -> Options: dest="files", help="generate stubs for given files or directories", ) + parser.add_argument( + "--version", action="version", version="%(prog)s " + mypy.version.__version__ + ) ns = parser.parse_args(args)