diff --git a/src/main.rs b/src/main.rs index a13173c..321a450 100644 --- a/src/main.rs +++ b/src/main.rs @@ -689,6 +689,16 @@ fn summarize(filter: &Option, tail: usize, args: &Args) -> Result<(), St .collect(); table_items.sort(); + let total = SummaryTableItem { + month: "Total".to_owned(), + total_hours: table_items.iter().map(|i| i.total_hours) + .fold(HumanDuration { hours: 0, minutes: 0 }, |a, b| a + b), + hours_per_week: "-".to_owned(), + days: table_items.iter().map(|i| i.days).sum(), + nitems: table_items.iter().map(|i| i.nitems).sum(), + }; + table_items.push(total); + let items_slice = if tail == 0 { table_items.as_slice() } else {