#terminal #cli #questionnaire

tquest

Simple observable pattern implementation

3 unstable releases

0.3.1 Jul 3, 2024
0.3.0 Jul 3, 2024
0.2.1 Jul 1, 2024

#396 in #terminal

31 downloads per month

MIT license

100KB
2.5K SLoC

ci crates.io

tquest

Rust library crate to implement terminal based questionnaires

Idea

Build a structure that guides through a set of cascaded questions, collect the related answers and use the bundled structe in the end to some further processing

Assumed Questions

  1. Do you want to do this questionaire? (y/N)
  2. What's your name? - string result, max length ...
  3. What's your day of birth? - string result, regexp check
  4. Do you have one or more siblings? (y/N) 4.1 What's the name of your sibling? 4.2 What's the date of birth of your sibling 4.3 Do you have further Siblings
  5. Do you worked already in a job? (y/N) 5.1. Where was that job? 5.2. What company you worked for? ...

Usage

cargo test -- --ignored

Dependencies

~6–19MB
~205K SLoC