Crates.io | yes-or-no |
lib.rs | yes-or-no |
version | 0.1.0 |
source | src |
created_at | 2024-07-31 21:19:48.767019 |
updated_at | 2024-07-31 21:19:48.767019 |
description | Very simple yes or no CLI tool |
homepage | https://github.com/AntoineRenaud91/yes-or-no |
repository | https://github.com/AntoineRenaud91/yes-or-no |
max_upload_size | |
id | 1321328 |
size | 46,295 |
A very simple yes or no CLI tool
Add yes-or-no
to your project's dependencies:
[dependencies]
yes-or-no = "0.1"
Here is an example of how to use yes-or-no
in your Rust project:
use yes_or_no::yes_or_no;
fn main() {
if yes_or_no("🦀 Do you like Rust? 🦀", true) {
println!("You like Rust! 🤩" );
} else {
println!("You don't like Rust... 😭");
}
}
When you run the program, you'll be presented with a prompt in your terminal:
Do you like Rust? Yes [✓] No [ ]
Depending on your selection, the program will output:
You like Rust! 😁
or
You don't like Rust... 😭