feat: add --json output mode for CLI results#6
Conversation
📝 WalkthroughWalkthroughThe changes introduce a global Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.rs`:
- Around line 517-519: The pre-parse JSON detector in wants_json_from_args only
checks for an exact "-j" and misses bundled short flags like "-uj"; update
wants_json_from_args to return true when any arg is "--json" or when an arg is a
short-flag bundle (starts with a single '-' but not '--') and its characters
after the first include 'j'. Implement this by iterating env::args(), checking
arg == "--json" first, then for args that start with '-' and not with "--" use
the characters after the leading '-' and return true if any is 'j' (preserving
the existing exact "-j" behavior as a subset).
Summary
--json/-joutput mode for machine-readable responsesValidation
Summary by CodeRabbit
Release Notes
New Features
--json/-jflag for JSON output mode across all commands, enabling structured programmatic consumption of command results and error information.Tests