omni_dev/cli/git/
amend.rs1use anyhow::{Context, Result};
4use clap::Parser;
5
6#[derive(Parser)]
8pub struct AmendCommand {
9 #[arg(value_name = "YAML_FILE")]
11 pub yaml_file: String,
12}
13
14impl AmendCommand {
15 pub fn execute(self) -> Result<()> {
17 use crate::git::AmendmentHandler;
18
19 crate::utils::check_git_repository()?;
21 crate::utils::check_working_directory_clean()?;
22
23 println!("🔄 Starting commit amendment process...");
24 println!("📄 Loading amendments from: {}", self.yaml_file);
25
26 let handler = AmendmentHandler::new().context("Failed to initialize amendment handler")?;
28
29 handler
30 .apply_amendments(&self.yaml_file)
31 .context("Failed to apply amendments")?;
32
33 Ok(())
34 }
35}