Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions codeflash/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[1:] or "-h" in sys.argv[1:]:
print_codeflash_banner()
args = parse_args()
if args.command != "auth":
print_codeflash_banner()
Expand Down
18 changes: 18 additions & 0 deletions tests/test_help_banner.py
Original file line number Diff line number Diff line change
@@ -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
Loading