diff --git a/codeflash/main.py b/codeflash/main.py index 5193fd736..21ed2c5f3 100644 --- a/codeflash/main.py +++ b/codeflash/main.py @@ -31,6 +31,8 @@ def main() -> None: from codeflash.cli_cmds.cli import parse_args + if "--help" in sys.argv[1:] or "-h" in sys.argv[1:]: + print_codeflash_banner() args = parse_args() # Auth commands skip banner, telemetry, and version check entirely diff --git a/tests/test_help_banner.py b/tests/test_help_banner.py new file mode 100644 index 000000000..c5d801b23 --- /dev/null +++ b/tests/test_help_banner.py @@ -0,0 +1,18 @@ +import subprocess +import sys + + +def test_help_displays_logo() -> None: + result = subprocess.run( + [sys.executable, "-c", "from codeflash.main import main; main()", "--help"], capture_output=True, text=True + ) + assert result.returncode == 0 + assert "codeflash.ai" in result.stdout + + +def test_help_short_flag_displays_logo() -> None: + result = subprocess.run( + [sys.executable, "-c", "from codeflash.main import main; main()", "-h"], capture_output=True, text=True + ) + assert result.returncode == 0 + assert "codeflash.ai" in result.stdout