Crates.io | term-inquiry |
lib.rs | term-inquiry |
version | 0.1.2 |
source | src |
created_at | 2021-05-27 22:02:29.856033 |
updated_at | 2023-08-22 17:16:58.61689 |
description | Quick and easy way to make terminal inquiries using builder pattern. |
homepage | |
repository | https://github.com/ParagonPawns/term-inquiry |
max_upload_size | |
id | 402886 |
size | 24,396 |
Term Inquiry is a crate that allows creating various types of inquiries. This projecte is still a work in progress.
All inquiry types will have an example in the examples
folder. So feel free
to try them out.
Provides a list of single choise options with a given message.
use term_inquiry::List;
List::<&'static str>::new("Please select an option")
.add_item("Option 1", "value1")
.add_item("Option 2", "value2")
.add_item("Option 3", "value3")
.inquire();
output
[?] Please select an option:
→ Option 1
Option 2
Option 3
Provides a list of check boxes (multiple choise) with a given message.
CheckboxList::<&'static str>::new(String::from("Please select an option:"))
.add_item("Option 1", "value1")
.add_item("Option 2", "value2")
.add_item("Option 3", "value3")
.inquire();
output
[?] Please select an option: Press 'a' to accept selection
→ [✘] Option 1
[✘] Option 2
[✘] Option 2