use clap::{Parser, Subcommand};
pub mod catalog;
pub mod compare;
pub mod identify;
pub mod score;
#[derive(Parser)]
#[command(name = "ref-solver")]
#[command(author = "Fulcrum Genomics")]
#[command(version)]
#[command(about = "Identify and match reference genomes from BAM/SAM headers")]
#[command(
long_about = "ref-solver helps you identify which reference genome was used to align a BAM/SAM/CRAM file.\n\nIt matches the sequence dictionary from your file against a catalog of known human reference genomes and provides:\n- Exact matches when possible\n- Detailed diagnostics when differences exist\n- Actionable suggestions for fixing mismatches (renaming, reordering)"
)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
#[arg(short, long, global = true)]
pub verbose: bool,
#[arg(short, long, global = true, default_value = "text")]
pub format: OutputFormat,
}
#[derive(Subcommand)]
#[allow(clippy::large_enum_variant)]
pub enum Commands {
Identify(identify::IdentifyArgs),
Compare(compare::CompareArgs),
Score(score::ScoreArgs),
Catalog(catalog::CatalogArgs),
Serve(ServeArgs),
}
#[derive(clap::Args)]
pub struct ServeArgs {
#[arg(short, long, default_value = "8080")]
pub port: u16,
#[arg(short, long, default_value = "127.0.0.1")]
pub address: String,
#[arg(long)]
pub open: bool,
#[arg(long, default_value = crate::refget::DEFAULT_REFGET_SERVER)]
pub refget_server: String,
#[arg(long)]
pub no_refget: bool,
}
#[derive(Clone, Copy, Debug, clap::ValueEnum)]
pub enum OutputFormat {
Text,
Json,
Tsv,
}