//!
//! SPDX-License-Identifier: GPL-3.0-or-later
+// use std::env; // Replaced by clap::Parser stuff
use std::io; // bring flush() into scope with `use std::io::Write`
use std::io::prelude::*; // Bring `std::io::BufRead` in scope
use statrs::distribution::{Exp, LogNormal, ContinuousCDF}; // Continuous needed for pdf
// use statrs::statistics::Distribution;
// use statrs::prec;
+use clap::Parser;
+
const DEBUG: bool = false;
fn input() -> Vec<String> {
normalize(prio)
}
+#[derive(Parser, Debug)]
+#[command(author, version, about, long_about = None)]
+
+/// Rank N' Auto, automatic normalized ranking
+
+struct Args {
+
+ /// Ranking distribution skewness
+ #[arg(short)]
+ skewness: Option<String>,
+}
fn main() {
+ let args = Args::parse();
+
+ // let mut skew = 1.0;
+
+ if DEBUG { eprintln!("Arguments: {:?}", args) }
+
+ // Implement this with *match*, the non concise way, so that
+ // people understand.
+
+ let skew = match args.skewness {
+ None => 1.0,
+ Some(a) =>
+ if a == "light" {0.5}
+ else if a == "moderate" {1.0}
+ else if a == "heavy" {2.0}
+ else {1.0},
+ };
+
+ if DEBUG { eprintln!("Finally a skewness: {}", skew) }
let ranked: Vec<String> = input();
let num = ranked.len() as i32;