Crates.io | eprompt |
lib.rs | eprompt |
version | 0.3.0 |
source | src |
created_at | 2022-11-04 15:27:47.141646 |
updated_at | 2022-11-11 20:04:38.245278 |
description | Easy to use interactive prompt library. No complex structs or traits, just a few simple to use functions. |
homepage | https://github.com/dmaahs2017/eprompt/ |
repository | |
max_upload_size | |
id | 705245 |
size | 85,524 |
eprompt is a easy to use prompt library for rust.
No complicated structs, or traits. Just simple functions that do what they say.
Usage example:
use eprompt::*;
// user can use j, k, up or down to change selection. Space to check a box, enter to finalize.
let tasks: Vec<_> = multi_select("What would you like to do today?", &["Eat a cake", "Go to work", "Go on a hike"]).unwrap();
// user can use j, k, up or down to change selection, space or enter to finalize.
let selection: &f32 = select("Choose an option", &[6.9, 3.14])).unwrap();
// This will automatically parse the input to the desired type. If the input is invalid it will have the user try again.
let age: i32 = input("How old are you?").unwrap();