Skip to main content

ask

Function ask 

Source
pub fn ask(
    action: &str,
    processes: &[Process],
    not_found: Option<&[String]>,
    question: &str,
    show: impl FnOnce(),
) -> Result<bool>
Expand description

Show show, the list of processes that action is about to change, and ask question. Ok(true) is a yes and Ok(false) a no.

show prints the list with the usual output macros; this decides which stream they reach. When the list cannot be shown the result is the error ConfirmationRequired, carrying processes and not_found as every refusal does.