requestty 0.6.3

An easy-to-use collection of interactive cli prompts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() {
    let question = requestty::Question::int("age")
        .message("What is your age?")
        .default(69)
        .validate_on_key(|age, _| age > 0 && age < 130)
        .validate(|age, _| {
            if age > 0 && age < 130 {
                Ok(())
            } else {
                Err(format!("You cannot be {} years old!", age))
            }
        })
        .build();

    println!("{:#?}", requestty::prompt_one(question));
}