Crates.io | uquery |
lib.rs | uquery |
version | 0.2.2 |
source | src |
created_at | 2021-02-17 13:36:16.977688 |
updated_at | 2022-01-25 07:23:39.237088 |
description | A simple library to display information to the user and to query them for information in a bright, colourful manner. |
homepage | |
repository | https://gitlab.com/john_t/uquery |
max_upload_size | |
id | 356461 |
size | 35,494 |
A simple way to create simple yet easy to use command line experiences. uQuery allows you both to query the user for data, and display user errors and warnings
use std::io;
fn main() -> io::Result<()> {
let name = uquery::string("What is your name?")?;
println!("Hello {}.", name);
let day = uquery::string_with_default(
"What is your favourite day?",
Some("Monday"),
)?;
println!(r#"I see your favourite day is "{}"."#, day);
let number: usize = uquery::parsable_with_default("Whats your favourite number?", 7)?;
println!("Hello {} lover", number);
let age: u8 = uquery::parsable("How old are you?")?;
println!("Hello {} year old.", age);
let happy = uquery::boolean("Are you happy?", None)?;
println!("It is {} that you are happy.", happy);
Ok(())
}