[](https://crates.io/crates/trompt)
[](https://gitlab.com/runarberg/trompt/commits/master)
Trompt
======
> Prompt your users with style
[Documentation](https://docs.rs/trompt)
*Trompt* aims to be a fully featured simple to use prompting libarary
for rust.
To get started add…
```toml
[dependencies]
trompt = "0.0.3"
```
…to your `Cargo.toml`, and…
```rust
extern crate trompt;
```
…at the top level of your crate.
From now on you can prompt your users using the `trompt::Trompt`
struct.
### Example ###
```rust
extern crate trompt;
use trompt::Trompt;
fn main() {
let stdin = std::io::stdin();
let mut input = stdin.lock();
let mut output = std::io::stdout();
let usr = Trompt::new(&mut input, &mut output)
.required()
.prompt("Username: ");
let pwd = Trompt::new(&mut input, &mut output)
.silent()
.min_len(8)
.prompt("Password: ");
let is_sure = Trompt::new(&mut input, &mut output)
.confirm("Are you sure [yn]? ");
println!(
"{}:{}, {}",
usr.unwrap(),
pwd.unwrap(),
if is_sure.unwrap() { "is sure" } else { "is unsure" },
);
}
```