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
13
14
15
/// Macro `input!`, similar to Python's `input()`.
///
/// Usage:
/// ```no_run
/// use askit::input;
///
/// fn sample() {
///     let name = input!("Enter your name: ");
///     println!("Hello, {name}");
/// }
/// ```
#[macro_export]
macro_rules! input {
    ($msg:expr) => {{ $crate::prompt($msg).get::<String>().unwrap() }};
}