pub mod add;
pub mod list;
pub mod remove;
use crate::Project;
use clap::Parser;
use std::path::PathBuf;
#[derive(Parser, Debug)]
pub struct Args {
#[clap(long, global = true)]
pub manifest_path: Option<PathBuf>,
#[clap(subcommand)]
pub command: Command,
}
#[derive(Parser, Debug)]
pub enum Command {
Add(add::Args),
List,
Remove(remove::Args),
}
pub async fn execute(args: Args) -> miette::Result<()> {
let project = Project::load_or_else_discover(args.manifest_path.as_deref())?;
match args.command {
Command::Add(args) => add::execute(project, args).await,
Command::List => list::execute(project).await,
Command::Remove(args) => remove::execute(project, args).await,
}
}