use std::{fs, path::PathBuf};
pub(super) fn input(
value: Option<String>,
file: Option<PathBuf>,
) -> Result<String, Box<dyn std::error::Error>> {
match (value, file) {
(Some(value), None) => Ok(value),
(None, Some(path)) => Ok(fs::read_to_string(path)?),
(Some(_), Some(_)) => Err("provide a prompt or --file, not both".into()),
(None, None) => Err("a prompt or --file is required".into()),
}
}