Skip to content

Commit 07bd44d

Browse files
authored
perf: add --version fast-path to skip full import chain
perf: add --version fast-path to skip full import chain
2 parents 6f3f884 + fd7e2c0 commit 07bd44d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

codeflash/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222

2323
def main() -> None:
2424
"""Entry point for the codeflash command-line interface."""
25+
# Fast path: --version exits before importing the full stack
26+
if len(sys.argv) == 2 and sys.argv[1] == "--version":
27+
from codeflash.version import __version__
28+
29+
print(f"Codeflash version {__version__}")
30+
return
31+
2532
from pathlib import Path
2633

2734
from codeflash.cli_cmds.cli import parse_args, process_pyproject_config

0 commit comments

Comments
 (0)