use anyhow::Result;
use clap::Args;
use stkd_core::Repository;
use crate::output;
#[derive(Args)]
pub struct DeleteArgs {
branch: String,
#[arg(long, short)]
force: bool,
}
pub async fn execute(args: DeleteArgs) -> Result<()> {
let repo = Repository::open(".")?;
if !args.force {
if !output::confirm(&format!("Delete branch '{}'?", args.branch)) {
output::info("Cancelled");
return Ok(());
}
}
repo.delete_branch(&args.branch, args.force)?;
output::success(&format!("Deleted branch '{}'", args.branch));
Ok(())
}