Skip to content

Commit

Permalink
Updated README for input prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Jan 17, 2020
1 parent e86c6ea commit 33fc431
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
55 changes: 45 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
<h1 align="center">enquirer</h1>

<p align="center">
<a href="https://travis-ci.org/termapps/enquirer">
<img src="https://img.shields.io/travis/termapps/enquirer.svg" alt="travis">
</a>
<a href="https://travis-ci.org/termapps/enquirer">
<img alt="Travis" src="https://img.shields.io/travis/termapps/enquirer?style=flat-square" alt="travis">
</a>
<a href="https://termapps.zulipchat.com/#narrow/stream/220422-enquirer">
<img alt="Zulip" src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg?style=flat-square">
</a>
<a href="https://crates.io/crates/enquirer">
<img alt="Crates.io" src="https://img.shields.io/crates/v/reign?style=flat-square">
</a>
</p>

<p align="center">
<b>Command Line Utility for Stylish Interactive Prompts</b>
<br>
<sub>(like fzf but for all types)</sub>
<br>
<sub>(uses <a href="https://github.com/mitsuhiko/dialoguer">dialoguer</a> underneath)</sub>
<b>Command Line Utility for Stylish Interactive Prompts</b>
<br>
<sub>(like fzf but for all types)</sub>
<br>
<sub>(uses <a href="https://github.com/mitsuhiko/dialoguer">dialoguer</a> underneath)</sub>
</p>

## Getting started
Expand Down Expand Up @@ -85,6 +91,7 @@ FLAGS:
SUBCOMMANDS:
confirm Prompt that returns `true` or `false`
help Prints this message or the help of the given subcommand(s)
input Prompt that takes user input and returns a string
```

### Library
Expand All @@ -111,19 +118,20 @@ fn main() {
## Prompts

* [Confirm Prompt](#confirm-prompt)
* [Input Prompt](#input-prompt)

### Confirm Prompt

Prompt that returns `true` or `false` (as strings).

<p align="center">
<img src="media/confirm.svg" alt="Enquirer Confirm Prompt" width="750">
<img src="media/confirm.svg" alt="Enquirer Confirm Prompt" width="750">
</p>

#### Usage

```
enquirer 0.1.0
enquirer-confirm 0.1.0
Prompt that returns `true` or `false`
USAGE:
Expand All @@ -138,6 +146,33 @@ OPTIONS:
-m, --message <message> Message for the prompt
```

### Input Prompt

Prompt that takes user input and returns a string.

<p align="center">
<img src="media/input.svg" alt="Enquirer Input Prompt" width="750">
</p>

#### Usage

```
enquirer-input 0.1.0
Prompt that takes user input and returns a string
USAGE:
enquirer input [FLAGS] [OPTIONS] --message <message>
FLAGS:
-a, --allow-empty Allow empty input. Conflicts with `default`
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-d, --default <default> Default value for the prompt
-m, --message <message> Message for the prompt
```

## About

### Changelog
Expand Down
1 change: 1 addition & 0 deletions media/input.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Theme for ColoredTheme {
default: Option<&str>,
) -> fmt::Result {
let details = match default {
Some(default) => format!(" [{}]", default),
Some(default) => format!(" ({})", default),
None => "".to_string(),
};

Expand Down

0 comments on commit 33fc431

Please sign in to comment.