From 5603ccfd25281abecea799364fc8c5feff9c2c91 Mon Sep 17 00:00:00 2001 From: Piv <18462828+Piv200@users.noreply.github.com> Date: Thu, 9 Mar 2023 21:29:25 +1030 Subject: [PATCH] Add exclude negative allocation statistics option to overhead allocation --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 698bf8c..54f975c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,6 +60,9 @@ enum Commands { #[arg(long, default_value = "E")] account_type: String, + #[arg(short, long)] + exclude_negative_allocation_statistics: bool, + #[arg(short, long, value_name = "FILE")] output: Option, }, @@ -94,6 +97,7 @@ fn main() -> anyhow::Result<()> { cost_centres, use_numeric_accounts, account_type, + exclude_negative_allocation_statistics, output, } => allocate_overheads( lines, @@ -103,6 +107,7 @@ fn main() -> anyhow::Result<()> { cost_centres, use_numeric_accounts, account_type, + exclude_negative_allocation_statistics, output, ), } @@ -136,6 +141,7 @@ fn allocate_overheads( cost_centres: PathBuf, use_numeric_accounts: bool, account_type: String, + exclude_negative_allocation_statistics: bool, output: Option, ) -> anyhow::Result<()> { coster_rs::reciprocal_allocation( @@ -146,7 +152,7 @@ fn allocate_overheads( csv::Reader::from_path(cost_centres)?, &mut csv::Writer::from_path(output.unwrap_or(PathBuf::from("alloc_output.csv")))?, use_numeric_accounts, - false, + exclude_negative_allocation_statistics, true, account_type, )