clytia 0.2.1

A crate to make writing CLIs a bit nicer, a set of functions for common components
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use clytia::{Clytia, Result};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut clytia = Clytia::default();

    println!("What animal do you like?");
    let choice = clytia.options_menu(["cats", "dogs", "both"])?;
    match choice {
        "cats" => println!("What about dogs?"),
        "dogs" => println!("But what about cats?"),
        "both" => println!("Good choice!"),
        _ => unreachable!(),
    }

    Ok(())
}