CLI command architecture and DB-backed model update syncing (#397)

This commit is contained in:
Gregory Schier
2026-02-17 08:20:31 -08:00
committed by GitHub
parent 0a4ffde319
commit e1580210dc
48 changed files with 3818 additions and 1180 deletions

View File

@@ -0,0 +1,16 @@
use std::io::{self, IsTerminal, Write};
pub fn confirm_delete(resource_name: &str, resource_id: &str) -> bool {
if !io::stdin().is_terminal() {
eprintln!("Refusing to delete in non-interactive mode without --yes");
std::process::exit(1);
}
print!("Delete {resource_name} {resource_id}? [y/N]: ");
io::stdout().flush().expect("Failed to flush stdout");
let mut input = String::new();
io::stdin().read_line(&mut input).expect("Failed to read confirmation");
matches!(input.trim().to_lowercase().as_str(), "y" | "yes")
}