Skip to content

Phase 2a: Port argument parsing and CLI entry point to Rust - #30

Merged
zackees merged 1 commit into
mainfrom
rust/phase-2a-cli-args
Apr 12, 2026
Merged

zackees merged 1 commit into
mainfrom
rust/phase-2a-cli-args

Conversation

@zackees

@zackees zackees commented Apr 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Rewrites crates/fastled-cli/src/main.rs from a hello-world stub into a full clap CLI that mirrors every flag defined in src/fastled/parse_args.py
  • Positional [DIRECTORY], all boolean flags (--just-compile, --profile, --app, --install, --dry-run, --no-interactive, --no-https, --latest, --purge, --debug, --quick, --release), and value flags (--serve-dir, --init [EXAMPLE], --branch, --commit, --fastled-path) are all declared
  • Build-mode flags (--debug, --quick, --release) use conflicts_with_all to enforce mutual exclusivity matching the Python add_mutually_exclusive_group
  • After parsing, the binary locates the Python interpreter (VIRTUAL_ENV → python → python3) and execs python -m fastled.app <forwarded-args>, returning Python's exit code — zero behaviour change

Closes #18

Test plan

  • ./_cargo build --workspace — compiles clean
  • ./_cargo test --workspace — 0 test failures
  • ./_cargo clippy --workspace --all-targets -- -D warnings — clean
  • ./_cargo fmt --all --check — clean
  • ./target/x86_64-pc-windows-msvc/debug/fastled.exe --help — shows all flags
  • ./target/x86_64-pc-windows-msvc/debug/fastled.exe --version — prints fastled 2.0.6
  • bash lint — all checks pass
  • bash test (120/121) — 1 pre-existing test_api.py failure due to no network in CI environment

Mirror all Python flags from parse_args.py into a clap-based Rust CLI.
The binary parses args strictly then delegates to `python -m fastled.app`
as a subprocess, forwarding all flags verbatim so behaviour is unchanged.
@zackees
zackees merged commit 5357670 into main Apr 12, 2026
3 of 9 checks passed
@zackees
zackees deleted the rust/phase-2a-cli-args branch November 5, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 2a: Port argument parsing and CLI entry point to Rust

1 participant