pub fn confirm(
prompt: impl ToString,
default: Option<bool>,
) -> Result<bool, Error>
Expand description
Prompts the user with a yes/no question.
§Arguments
prompt
: The prompt to display to the user.default
: If notNone
, allows the user to answer a default yes/no based on the given boolean value (true for yes, false for no).
§Returns
True if the user answered yes, or else false.
§Errors
This function errors if we failed to interact with the user.