ucli 0.2.2

A command line interface for CLI applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use ucli::item::UCLISelectItem;
use ucli::select::UCLISelect;
use ucli::ucli::Main;

fn main() {
    let options = UCLISelect::new(vec![
        UCLISelectItem::new("Cat".to_string(), "🐈", true),
        UCLISelectItem::new("Dog".to_string(), "🐕", false),
        UCLISelectItem::new("Mouse".to_string(), "🐁", false),
    ]);
    print!("Select an animal: ");
    let value = Main::new(options)
        .enable_mouse()
        .render(false)
        .get();
    println!("You selected: {:?}", value);
}