Skip to content

Commit

Permalink
export report to report.csv by default
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroXbrock committed Jan 8, 2025
1 parent f47bf5f commit 8d6ffff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
cargotest.toml
*.db
report.csv
5 changes: 5 additions & 0 deletions crates/cli/src/commands/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ pub fn report(
let mut writer = WriterBuilder::new().has_headers(true).from_path(out_file)?;
write_run_txs(&mut writer, &txs)?;
} else {
// print to stdout and write to default file
let mut writer = WriterBuilder::new()
.has_headers(true)
.from_writer(std::io::stdout());
write_run_txs(&mut writer, &txs)?; // TODO: write a macro that lets us generalize the writer param to write_run_txs, then refactor this duplication
let mut writer = WriterBuilder::new()
.has_headers(true)
.from_path("report.csv")?;
write_run_txs(&mut writer, &txs)?;
};

Ok(())
Expand Down

0 comments on commit 8d6ffff

Please sign in to comment.