From 3aae6fd225bb2240a03238a23138b0c52a2b76c8 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 20 Nov 2024 22:15:05 +0000 Subject: [PATCH] Add --version option to show abi3audit version information (#123) --- abi3audit/_cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/abi3audit/_cli.py b/abi3audit/_cli.py index bb15125..86f5e85 100644 --- a/abi3audit/_cli.py +++ b/abi3audit/_cli.py @@ -29,6 +29,8 @@ from abi3audit._object import SharedObject from abi3audit._state import console, status +from . import __version__ + logger = logging.getLogger(__name__) logging.basicConfig( level=os.environ.get("ABI3AUDIT_LOGLEVEL", "INFO").upper(), @@ -175,6 +177,7 @@ def main() -> None: prog="abi3audit", description="Scans Python extensions for abi3 violations and inconsistencies", ) + parser.add_argument("-V", "--version", action="version", version=f"%(prog)s {__version__}") parser.add_argument( "specs", metavar="SPEC",