askit 0.2.0

A simple and semantic library to ask for user input in CLI applications. Type-safe parsing, defaults and retries.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use askit::prompt_mod::prompt;

fn main() -> Result<(), askit::Error> {
    // Default tipado: não precisa parse
    let port: u16 = prompt("Port [typed default=5432]: ")
        .to()
        .default_val(5432)
        .get()?;

    println!("Port = {port}");
    Ok(())
}