cli_confirm

Function cli_confirm 

Source
pub fn cli_confirm(message: &str) -> bool
Expand description

Requests confirmation from the user.

Displays a message and prompts the user to answer yes (y) or no (n). The function will continue prompting until a valid response is received.

§Arguments

  • message - The confirmation message to display

§Returns

Returns true if the user answered ‘y’, false if they answered ‘n’.

§Example

use falcon_cli::cli_confirm;

if cli_confirm("Do you want to continue?") {
    println!("Continuing...");
} else {
    println!("Cancelled.");
}