-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Current Behavior
Running `chainsaw trace --diff-from snapshot.json --json src/index.ts` ignores the `--json` flag and always outputs terminal-formatted text.
Expected Behavior
When `--json` is specified alongside `--diff-from`, the diff result should be output as JSON.
Context
Users who want to programmatically compare snapshots cannot get machine-readable output from `--diff-from`.
Technical Details
Relevant Code
`src/main.rs:334-340` -- run_trace
```rust
if let Some(ref snapshot_path) = args.diff_from {
let saved = load_snapshot(snapshot_path)?;
let diff = query::diff_snapshots(&saved, &result.to_snapshot(&entry_rel));
let report = report::DiffReport::from_diff(&diff, &saved.entry, &entry_rel, args.limit);
print!("{}", report.to_terminal(color));
return Ok(());
}
```
The `--diff-from` branch unconditionally calls `to_terminal()` without checking `args.json`.