Skip to content

CLI: accept --run-* flag in any position#175

Merged
danieljohnmorris merged 1 commit into
mainfrom
fix/run-flag-placement
May 11, 2026
Merged

CLI: accept --run-* flag in any position#175
danieljohnmorris merged 1 commit into
mainfrom
fix/run-flag-placement

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Doc-cited friction: --run-tree placement was strict (must follow filename), so ilo --run-tree file.ilo main failed cryptically. Pre-scan extracts the engine flag from any position before positional dispatch. Repeated identical flags accepted as no-op; conflicting flags still error. clap subcommand path unchanged. 17 cli regression tests covering leading/trailing/mixed positions.

Doc cited that `--run-tree` placement matters - must come after
filename, not before. Cryptic argument-order failures cost agent
retries on every fresh CLI invocation.

Added extract_run_engine_flag helper that pre-scans the bare-args
vector for any --run / --run-tree / --run-vm / --run-cranelift /
--run-llvm flag, regardless of position. Result OR's into the
existing positional engine detection.

Repeated identical flag is silently accepted (no-op). Mutually
exclusive flags still error with the same message. The clap
subcommand path is unchanged.

17 cli regression tests cover leading, trailing, mixed positions,
file and inline-code shapes, repeated and conflicting combos.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris merged commit 64d1ec8 into main May 11, 2026
5 checks passed
@danieljohnmorris danieljohnmorris deleted the fix/run-flag-placement branch May 11, 2026 23:08
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.

1 participant