Crates.io | cli_select |
lib.rs | cli_select |
version | 0.1.6 |
source | src |
created_at | 2022-01-25 19:54:32.452316 |
updated_at | 2023-10-15 13:51:11.376227 |
description | A crate build on top of crossterm to provide a simple customizable select dialog for the command line. |
homepage | |
repository | https://github.com/Preyde/cli_select/ |
max_upload_size | |
id | 521040 |
size | 27,905 |
A crate build on top of crossterm to provide a simple customizable select dialog for the command line.
Cargo.toml
[dependencies]
cli_select = "0.1.4"
main.rs
use cli_select::Select;
fn main() {
let items = vec!["item1", "item2", "item3"];
let select = Select::new(&items);
let selected_item = select.start();
println!("You selected: {}", selected_item);
}
> item1
item2
item3
You selected: item1
main.rs
use cli_select::Select;
fn main() {
let items = vec!["item1", "item2", "item3"];
let select = Select::new(&items);
let selected_item = select
.pointer('◉')
.not_selected_pointer('🞅')
.move_selected_item_forward()
.start();
println!("You selected: {}", selected_item);
}
◉ item1
🞅 item2
🞅 item3
You selected: item1