Crate askit

Source
Expand description

askit: a simple and semantic CLI input library.

Quickstart:

use askit::prompt;

fn main() -> Result<(), askit::Error> {
    let name: String = prompt("Name: ").get()?;
    let age: u8 = prompt("Age [18]: ").default("18").retries(2).get()?;
    println!("Hello, {} ({}).", name, age);
    Ok(())
}

Macros§

input
Sugar macro similar to Python’s input().

Structs§

Prompt
Untyped builder for reading and parsing CLI input.
TypedPrompt
Typed builder for extras: .default_val, .validate, .message.

Enums§

Error
Errors that askit may return.

Functions§

prompt
Entry-point function to create a Prompt.