ineed 0.1.1

Lightweight CLI prompting library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! You can ask for passwords, by enabling the "rpassword" feature.

use ineed::prelude::*;

fn main() -> anyhow::Result<()> {
    let password = ineed::password("Your new password")
        .then(ineed::password("Confirm"))
        .fmt(ineed::fmt().repeat_prompt(true))
        .until(|(a, b)| a == b)
        .map(|(password, _confirm)| password)
        .prompt()?;

    println!("We have safely registered your new password (btw it's {password})");

    Ok(())
}