asking 0.0.2

Build async prompts.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Short application to be tested through the example `testing`.
//!
//! This examples shows the use of
//! - `yn`

#[async_std::main]
async fn main() {
    asking::yn()
        .message("Do you like testing? ")
        .help("Please use format y/n. Try again: ")
        .feedback(|b| match *b {
            true => "Great!".to_string(),
            false => "Oh no!".to_string(),
        })
        .ask()
        .await
        .expect("Failed to ask the question");
}