inquire
inquire
is a library for building interactive prompts on terminals, inspired by survey.
Demo
Examples
Examples can be found in the examples
directory. Run them to see basic behavior:
$ cargo run --example form --features date
Prompts
Currently, there are 5 different prompt types supported.
Text
Text is the standard kind of prompt you would expect from a library like this one. It displays a message to the user, prompting them to type something back. The user's input is then stored in a String
and returned to the prompt caller.
// ./examples/text_simple.rs
let name = new.prompt;
match name
With Text, you can customize several aspects:
- Help message: Display a helpful message at the line below the prompt.
- Default value: Set a default value for when the user just presses enter without any text input.