use super::{Error, Fx, Outcome};
use crate::template::RealGit;
use std::path::PathBuf;
#[derive(clap::Args, Debug)]
pub struct Args {
pub workspace: PathBuf,
pub agent: String,
#[arg(long)]
pub children: bool,
#[arg(long)]
pub dry_run: bool,
}
pub fn run(args: Args, _fx: &mut Fx) -> Result<Outcome, Error> {
crate::name::require_agent_id(&args.agent).map_err(|e| Error::new("delete", e))?;
let report = crate::archive::delete(
&args.workspace,
&args.agent,
args.children,
args.dry_run,
&RealGit::new(),
)
.map_err(|e| Error::new("delete", e))?;
Ok(Outcome::Line(report.to_string()))
}