mod cli;
mod commands;

use commands::{clone, info, install, list, remove, update};

use clap::Parser;

use crate::cli::{Cli, Command};

fn main() -> anyhow::Result<()> {
    let cli = Cli::parse();

    match cli.command {
        Command::Clone { name } => clone::handle(&name),
        Command::Install { name } => install::handle(&name),
        Command::Update { repo, dry_run } => update::handle(repo.as_deref(), dry_run),
        Command::Remove { repo, keep_repo } => remove::handle(&repo, keep_repo),
        Command::List { outdated } => list::handle(outdated),
        Command::Info { repo } => info::handle(&repo),
    }
}
