From 2e034d06c877d6f2d3383f77e33e64b7547b7dc7 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Tue, 22 Jun 2021 14:29:33 +1000 Subject: [PATCH] Fix error with --meek-nz-exclusion, etc. on CLI --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4defe22..1a25dc6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,7 +130,7 @@ struct STV { transferable_only: bool, /// Method of exclusions - #[clap(help_heading=Some("STV VARIANTS"), long, possible_values=&["single_stage", "by_value", "parcels_by_order"], default_value="single_stage", value_name="method")] + #[clap(help_heading=Some("STV VARIANTS"), long, possible_values=&["single_stage", "by_value", "parcels_by_order", "wright"], default_value="single_stage", value_name="method")] exclusion: String, /// (Meek STV) NZ Meek STV behaviour: Iterate keep values one round before candidate exclusion @@ -220,13 +220,16 @@ where &cmd_opts.surplus_order, cmd_opts.transferable_only, &cmd_opts.exclusion, + cmd_opts.meek_nz_exclusion, cmd_opts.bulk_exclude, cmd_opts.defer_surpluses, cmd_opts.meek_immediate_elect, - cmd_opts.meek_nz_exclusion, cmd_opts.pp_decimals, ); + // Validate options + stv_opts.validate(); + // Describe count let total_ballots = election.ballots.iter().fold(N::zero(), |acc, b| { acc + &b.orig_value }); print!("Count computed by OpenTally (revision {}). Read {:.0} ballots from \"{}\" for election \"{}\". There are {} candidates for {} vacancies. ", opentally::VERSION, total_ballots, cmd_opts.filename, election.name, election.candidates.len(), election.seats);