use serde_json::{json, Value};

#[allow(dead_code)]
#[derive(Clone, Copy)]
pub enum OutputMode {
    Human,
    Json,
}

#[allow(dead_code)]
pub fn output_ok(mode: OutputMode, human_msg: &str, data: Value) {
    match mode {
        OutputMode::Human => println!("{human_msg}"),
        OutputMode::Json => println!("{}", json!({"ok": true, "data": data})),
    }
}

#[allow(dead_code)]
pub fn output_err(mode: OutputMode, msg: &str) {
    match mode {
        OutputMode::Human => eprintln!("Error: {msg}"),
        OutputMode::Json => println!("{}", json!({"ok": false, "error": msg})),
    }
}
