lacy 0.6.0

Fast magical cd alternative for lazy terminal navigators
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use dialoguer::{theme::ColorfulTheme, Select};

pub fn select(title: &str, options: Vec<String>) -> Option<String> {
    if let Some(selection) = Select::with_theme(&ColorfulTheme::default())
        .with_prompt(title)
        .items(&options)
        .default(0)
        .interact_opt()
        .unwrap()
    {
        return Some(options[selection].to_string());
    }
    None
}