Skip to main content

confirm

Function confirm 

Source
pub fn confirm(
    question: &str,
    input: &mut impl BufRead,
    output: &mut impl Write,
) -> Result<bool>
Expand description

Asks a yes/no question whose answer defaults to no.

Only y or yes mean yes. Everything else does not, and that includes end of input: a pipe with nothing in it is not consent, so a script that means to delete has to say so with a flag rather than by being silent.

ยงErrors

If the prompt cannot be written or the answer cannot be read.