Skip to content

Commit

Permalink
added confirm docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Dec 21, 2023
1 parent 5bd0719 commit 285a01a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,17 @@ fn main() {
## Confirm

Confirm a question with a yes or no.

![Confirm](./assets/confirm.png)

```rust
use demand::Confirm;

fn main() {
let ms = Confirm::new("Are you sure?")
.affirmative("Yes!")
.negative("No.");
let yes = ms.run().expect("error running confirm");
println!("yes: {}", yes);
}
```
Binary file added assets/confirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 285a01a

Please sign in to comment.