genome-sh 0.1.0

The jq of genomics. Fast, local, human-readable variant analysis.
use std::path::PathBuf;

use anyhow::Result;
use clap::Args;

use crate::api;

#[derive(Args)]
pub struct ServeArgs {
    /// Path to the SQLite database file.
    #[arg(short, long, default_value = "data/variants.db")]
    pub db: PathBuf,

    /// Host to bind to.
    #[arg(long, default_value = "0.0.0.0")]
    pub host: String,

    /// Port to listen on.
    #[arg(short, long, default_value = "3042")]
    pub port: u16,
}

impl ServeArgs {
    pub async fn run(self) -> Result<()> {
        api::serve(self.db, &self.host, self.port).await
    }
}