promptly
promptly copied to clipboard
Idea: enum prompts
I'm not sure if possible to do it in a similarily magic way as the rest of your code, but something like this would be great:
Failed to foo, do you want to continue? ( y[es] / n[o] / r[etry] )
With code similar to this (using e.g. strum
crate for enum introspection)
#[derive(Debug, EnumIter)]
pub enum YNR {
Yes,
No,
Retry,
}
loop {
match prompt("Failed to foo, do you want to continue?")? {
YNR::Yes => ..
YNR::No => ..
YNR::Retry => continue,
}
}