mod annotate;
mod compare;
mod config;
mod db;
mod extract;
mod predict;
mod query;
mod serve;
use anyhow::Result;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "genome",
about = "The jq of genomics. Fast, local, human-readable variant analysis.",
version,
after_help = "Run `genome <command> --help` for more information on a specific command."
)]
pub struct Cli {
#[command(subcommand)]
command: Command,
}
#[derive(Subcommand)]
enum Command {
Query(query::QueryArgs),
Annotate(annotate::AnnotateArgs),
Extract(extract::ExtractArgs),
Compare(compare::CompareArgs),
Predict(predict::PredictArgs),
Db(db::DbArgs),
Serve(serve::ServeArgs),
Config(config::ConfigArgs),
}
impl Cli {
pub async fn run(self) -> Result<()> {
match self.command {
Command::Query(args) => args.run().await,
Command::Annotate(args) => args.run().await,
Command::Extract(args) => args.run().await,
Command::Compare(args) => args.run().await,
Command::Predict(args) => args.run().await,
Command::Db(args) => args.run().await,
Command::Serve(args) => args.run().await,
Command::Config(args) => args.run(),
}
}
}