diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-01 12:43:00 +0530 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-01 12:43:52 +0530 |
commit | 961b743773da2a5112bd4ab70554c50b03ded3ad (patch) | |
tree | 08bc22433014e503e3bee1ffd86ae0be3cb48c5b /src/lib.rs | |
parent | c1cbcf355755fbd1ca6124cdba3b8e361a7bebf2 (diff) |
Add --no-total option
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -58,6 +58,7 @@ mod aggregate { pub fn aggregate( mut out: impl io::Write, options: WalkOptions, + compute_total: bool, paths: impl IntoIterator<Item = impl AsRef<Path>>, ) -> Result<WalkResult, Error> { let mut res = WalkResult::default(); @@ -90,8 +91,14 @@ mod aggregate { total += num_bytes; res.num_errors += num_errors; } - if num_roots > 1 { - write_path(&mut out, &options, Path::new("total"), total, res.num_errors)?; + if num_roots > 1 && compute_total { + write_path( + &mut out, + &options, + Path::new("total"), + total, + res.num_errors, + )?; } Ok(res) } |