mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
feat: use sys.argv[1:] for help check and add tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e3488bce6f
commit
48e6835990
2 changed files with 19 additions and 1 deletions
|
|
@ -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":
|
||||
|
|
|
|||
18
tests/test_help_banner.py
Normal file
18
tests/test_help_banner.py
Normal file
|
|
@ -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
|
||||
Loading…
Reference in a new issue