use anyhow::{Context, Result};
use clap::Parser;
#[derive(Parser)]
pub struct AmendCommand {
#[arg(value_name = "YAML_FILE")]
pub yaml_file: String,
}
impl AmendCommand {
pub fn execute(self) -> Result<()> {
use crate::git::AmendmentHandler;
crate::utils::check_git_repository()?;
crate::utils::check_working_directory_clean()?;
println!("🔄 Starting commit amendment process...");
println!("📄 Loading amendments from: {}", self.yaml_file);
let handler = AmendmentHandler::new().context("Failed to initialize amendment handler")?;
handler
.apply_amendments(&self.yaml_file)
.context("Failed to apply amendments")?;
Ok(())
}
}