# Requestty
![RustCI](https://github.com/Lutetium-Vanadium/requestty/workflows/Default/badge.svg)
![RustCI](https://github.com/Lutetium-Vanadium/requestty/workflows/Crossterm/badge.svg)
![RustCI](https://github.com/Lutetium-Vanadium/requestty/workflows/Termion/badge.svg)
[![Crates.io](https://img.shields.io/crates/v/requestty.svg)](https://crates.io/crates/requestty)
[![License](https://img.shields.io/crates/l/requestty.svg)](./LICENSE)
[![Documentation](https://docs.rs/requestty/badge.svg)](https://docs.rs/requestty)
`requestty` (request-tty) is an easy-to-use collection of interactive
cli prompts inspired by [Inquirer.js](https://github.com/SBoudrias/Inquirer.js).
- Easy-to-use - The builder API and macros allow you to easily configure
and use the in-built prompts.
- Extensible - Easily create and use custom prompts with a companion
ui rendering library.
- Flexible - All prompts can be used standalone or chained together.
- Dynamic - You can dynamically decide what questions should be asked
based on previous questions.
- Validation - You can validate user input with any prompt.
- Examples - Every prompt is accompanied with an example as well as other
[examples](./examples) for more complex workflows
## Usage
Add this to your `Cargo.toml`
```toml
[dependencies]
requestty = "0.3.0"
```
```rust
let question = requestty::Question::expand("overwrite")
.message("Conflict on `file.rs`")
.choices(vec![
('y', "Overwrite"),
('a', "Overwrite this one and all next"),
('d', "Show diff"),
])
.default_separator()
.choice('x', "Abort")
.build();
println!("{:#?}", requestty::prompt_one(question));
```
## In-built prompts
There are 10 in-built prompts:
- ### Input
Prompt that takes user input and returns a `String`.
- ### Password
Prompt that takes user input and hides it.