CLI: accept --run-* flag in any position#175
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Doc-cited friction:
--run-treeplacement was strict (must follow filename), soilo --run-tree file.ilo mainfailed 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.