main
John Lauer Publish 0.1.0 55a9481 2d ago
//! Every command answers the AI the same way: `OK: <what happened>` or `ERROR: <what is wrong>`,
//! then `Hint:` lines that depend on this project and this run. Exit 1 on ERROR.

pub fn ok(msg: &str, hints: &[String]) {
    println!("OK: {msg}");
    for h in hints.iter().filter(|h| !h.is_empty()) { println!("Hint: {h}"); }
}

pub fn err(msg: &str, hints: &[String]) -> ! {
    println!("ERROR: {msg}");
    for h in hints.iter().filter(|h| !h.is_empty()) { println!("Hint: {h}"); }
    std::process::exit(1)
}