From e3488bce6f2aaad2de00c6018a38e9b8dd6b27cb Mon Sep 17 00:00:00 2001 From: aseembits93 Date: Mon, 6 Apr 2026 16:06:56 -0700 Subject: [PATCH 1/3] feat: display logo when running `codeflash --help` Co-Authored-By: Claude Opus 4.6 --- codeflash/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codeflash/main.py b/codeflash/main.py index da0d83db6..22b6b5bae 100644 --- a/codeflash/main.py +++ b/codeflash/main.py @@ -33,6 +33,8 @@ def main() -> None: from codeflash.telemetry import posthog_cf from codeflash.telemetry.sentry import init_sentry + if "--help" in sys.argv or "-h" in sys.argv: + print_codeflash_banner() args = parse_args() if args.command != "auth": print_codeflash_banner() From 48e683599039ca76a8cb13f809848582eb959909 Mon Sep 17 00:00:00 2001 From: aseembits93 Date: Mon, 6 Apr 2026 16:09:47 -0700 Subject: [PATCH 2/3] feat: use sys.argv[1:] for help check and add tests Co-Authored-By: Claude Opus 4.6 --- codeflash/main.py | 2 +- tests/test_help_banner.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/test_help_banner.py diff --git a/codeflash/main.py b/codeflash/main.py index 22b6b5bae..37b18954a 100644 --- a/codeflash/main.py +++ b/codeflash/main.py @@ -33,7 +33,7 @@ def main() -> None: from codeflash.telemetry import posthog_cf from codeflash.telemetry.sentry import init_sentry - if "--help" in sys.argv or "-h" in sys.argv: + if "--help" in sys.argv[1:] or "-h" in sys.argv[1:]: print_codeflash_banner() args = parse_args() if args.command != "auth": diff --git a/tests/test_help_banner.py b/tests/test_help_banner.py new file mode 100644 index 000000000..62500e67b --- /dev/null +++ b/tests/test_help_banner.py @@ -0,0 +1,18 @@ +import subprocess +import sys + + +def test_help_displays_logo(): + 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(): + 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 From 8e2bab2e42fce6aa438ba98c711b85c146a4716c Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 23:12:44 +0000 Subject: [PATCH 3/3] fix: add missing return type annotations to test functions Co-authored-by: Aseem Saxena --- tests/test_help_banner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_help_banner.py b/tests/test_help_banner.py index 62500e67b..c5d801b23 100644 --- a/tests/test_help_banner.py +++ b/tests/test_help_banner.py @@ -2,7 +2,7 @@ import sys -def test_help_displays_logo(): +def test_help_displays_logo() -> None: result = subprocess.run( [sys.executable, "-c", "from codeflash.main import main; main()", "--help"], capture_output=True, text=True ) @@ -10,7 +10,7 @@ def test_help_displays_logo(): assert "codeflash.ai" in result.stdout -def test_help_short_flag_displays_logo(): +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 )