#builder-pattern #terminal #term #linux #multiple #inquiry #inquiries

term-inquiry

Quick and easy way to make terminal inquiries using builder pattern

3 releases

0.1.2 Aug 22, 2023
0.1.1 Jun 6, 2021
0.1.0 May 27, 2021

#24 in #builder-pattern

Download history 2/week @ 2024-02-21 14/week @ 2024-02-28 1/week @ 2024-03-06 5/week @ 2024-03-13 7/week @ 2024-03-20 18/week @ 2024-03-27 38/week @ 2024-04-03 12/week @ 2024-04-10 1/week @ 2024-04-17 3/week @ 2024-04-24

67 downloads per month
Used in cmake-version-manager

MIT license

20KB
468 lines

Term Inquiry

Term Inquiry is a crate that allows creating various types of inquiries. This projecte is still a work in progress.

Supported Platforms

  • Linux
  • OSX
  • Windows (tested on Windows 10 Powershell and nushell)

Inquiry Types

All inquiry types will have an example in the examples folder. So feel free to try them out.

List

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

CheckboxList

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

Dependencies

~0–34MB
~564K SLoC