use clap::{Parser, ValueEnum};
use crate::hasher::HashType;
const ASCII_ART: &str = r#"
/$$$$$$$$ /$$$$$$$ /$$
| $$_____/| $$__ $$ | $$
| $$ | $$ \ $$ /$$$$$$ /$$$$$$$ /$$ /$$ /$$$$$$
| $$$$$ | $$ | $$ /$$__ $$ /$$__ $$| $$ | $$ /$$__ $$
| $$__/ | $$ | $$| $$$$$$$$| $$ | $$| $$ | $$| $$ \ $$
| $$ | $$ | $$| $$_____/| $$ | $$| $$ | $$| $$ | $$
| $$ | $$$$$$$/| $$$$$$$| $$$$$$$| $$$$$$/| $$$$$$$/
|__/ |_______/ \_______/ \_______/ \______/ | $$____/
| $$
| $$
|__/
"#;
#[derive(Parser, Debug)]
#[command(
author,
version,
about = "A fast and memory-efficient FASTX PCR deduplication tool (Supports Paired-End)",
before_help = ASCII_ART,
arg_required_else_help = true
)]
#[command(help_expected = true)]
pub struct Cli {
#[arg(required = true, short = '1', long)]
pub input: String,
#[arg(short = '2', long, requires = "output_r2")]
pub input_r2: Option<String>,
#[arg(short = 'o', long, default_value = "output_R1.fastq.gz")]
pub output: String,
#[arg(short = 'p', long, requires = "input_r2")]
pub output_r2: Option<String>,
#[arg(long, short)]
pub force: bool,
#[arg(long, short)]
pub verbose: bool,
#[arg(long, short = 's')]
pub dry_run: bool,
#[arg(long, short = 't', default_value_t = 0.001)]
pub threshold: f64,
#[arg(long, short = 'H')]
pub hash: Option<HashMode>,
#[arg(long, short = 'c', default_value_t = 6, value_parser = clap::value_parser!(u32).range(1..=9))]
pub compression: u32,
#[arg(long, short = 'P', default_value_t = 150, value_parser = clap::value_parser!(usize))]
pub read_length: usize,
}
#[derive(ValueEnum, Clone, Debug)]
pub enum HashMode {
#[value(name = "64")]
Bit64,
#[value(name = "128")]
Bit128,
}
impl From<HashMode> for HashType {
fn from(mode: HashMode) -> Self {
match mode {
HashMode::Bit64 => HashType::XXH3_64,
HashMode::Bit128 => HashType::XXH3_128,
}
}
}