1 unstable release

0.1.0 Jul 31, 2024

#836 in Command-line interface

31 downloads per month

GPL-3.0-only

17KB

yes-or-no

A very simple yes or no CLI tool

Installation

Add yes-or-no to your project's dependencies:

[dependencies]
yes-or-no = "0.1"

Usage:

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 [ ]
  • Navigate between "Yes" and "No" using the left and right arrow keys.
  • Press Enter to select your choice.
  • Press Escape to automatically select "No".

Depending on your selection, the program will output:

You like Rust! 😁

or

You don't like Rust... 😭

lib.rs:

yes-or-no

A very simple yes or no CLI tool!

Installation

Add yes-or-no to your project's dependencies:

[dependencies]
yes-or-no = "0.1"

Usage:

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 [ ]
  • Navigate between "Yes" and "No" using the left and right arrow keys.
  • Press Enter to select your choice.
  • Press Escape to automatically select "No".

Depending on your selection, the program will output:

You like Rust! 😁

or

You don't like Rust... 😭

Dependencies

~2MB
~36K SLoC