fix(repl): add --json flag, error on unknown flags, route imports/importers through parse_flags#153
Closed
rocketman-code wants to merge 1 commit intomainfrom
Closed
fix(repl): add --json flag, error on unknown flags, route imports/importers through parse_flags#153rocketman-code wants to merge 1 commit intomainfrom
rocketman-code wants to merge 1 commit intomainfrom
Conversation
…orters through parse_flags - Add `json: bool` field to `CommandOptions` struct - Change `parse_flags` to return `Result`, rejecting unknown `--` flags with a helpful error message listing valid flags - Route `imports` and `importers` commands through `parse_flags` instead of `require_arg`, giving them access to inline flag overrides - Add `--json` output support to trace, chain, cut, packages, imports, and importers dispatch functions - Update help text to document `--json` as an inline flag - Add tests for `--json` parsing and unknown flag error handling
3 tasks
Owner
Author
|
Closing: patch contents already on main. Branch has zero diff after rebase. |
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.
Summary
Closes #143, closes #144, closes #147, closes #152
--jsoninline flag to all REPL commands that produce output (trace, chain, cut, packages, imports, importers), enabling structured JSON output for scripting and pipingparse_flagsto returnResult, rejecting unknown--flags with a helpful error listing valid options instead of silently ignoring themimportsandimporterscommands throughparse_flagsinstead ofrequire_arg, giving them access to all inline flag overrides (previously they only accepted a bare file argument)--jsonas an available inline flagTest plan
cargo test --lib repl)--jsonflag parsing and unknown flag error handlingcargo clippy --workspace --all-targets -- -D warningscleancargo fmt --checkclean