From 33fc43162e8a80176cb41f5becbaf765333e521f Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Fri, 17 Jan 2020 22:47:05 +0530 Subject: [PATCH] Updated README for input prompt --- README.md | 55 ++++++++++++++++++++++++++++++++++++++++--------- media/input.svg | 1 + src/theme.rs | 2 +- 3 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 media/input.svg diff --git a/README.md b/README.md index 8308f65..f5af30a 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,23 @@

enquirer

- - travis - + + Travis + + + Zulip + + + Crates.io +

- Command Line Utility for Stylish Interactive Prompts -
- (like fzf but for all types) -
- (uses dialoguer underneath) + Command Line Utility for Stylish Interactive Prompts +
+ (like fzf but for all types) +
+ (uses dialoguer underneath)

## Getting started @@ -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 @@ -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).

- Enquirer Confirm Prompt + Enquirer Confirm Prompt

#### Usage ``` -enquirer 0.1.0 +enquirer-confirm 0.1.0 Prompt that returns `true` or `false` USAGE: @@ -138,6 +146,33 @@ OPTIONS: -m, --message Message for the prompt ``` +### Input Prompt + +Prompt that takes user input and returns a string. + +

+ Enquirer Input Prompt +

+ +#### Usage + +``` +enquirer-input 0.1.0 +Prompt that takes user input and returns a string + +USAGE: + enquirer input [FLAGS] [OPTIONS] --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 value for the prompt + -m, --message Message for the prompt +``` + ## About ### Changelog diff --git a/media/input.svg b/media/input.svg new file mode 100644 index 0000000..55b7b28 --- /dev/null +++ b/media/input.svg @@ -0,0 +1 @@ +enquirerinput-m"Whatisyourgithubusername?"enquirerinput-m"Whatisyourgithubusername?"?Whatisyourgithubusername??Whatisyourgithubusername?pkWhatisyourgithubusername?·pksunkarapksunkaraenquirerinput-m"Whatisyourgithubusername?"-aenquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USER?Whatisyourgithubusername?(pksunkara)enquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USERWhatisyourgithubusername?·termappstermappsenquirerinput-m"Whatisyourgithubusername?"-aWhatisyourgithubusername?·?Whatisyourgithubusername?p?Whatisyourgithubusername?pku?Whatisyourgithubusername?pks?Whatisyourgithubusername?pksu?Whatisyourgithubusername?pksun?Whatisyourgithubusername?pksunk?Whatisyourgithubusername?pksunka?Whatisyourgithubusername?pksunkar?Whatisyourgithubusername?pksunkaraenquirerinput-m"Whatisyourgithubusername?"-aenquirerinput-m"Whatisyourgithubusername?"-aenquirerinput-m"Whatisyourgithubusername?"-denquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USER?Whatisyourgithubusername?(pksunkara)t?Whatisyourgithubusername?(pksunkara)te?Whatisyourgithubusername?(pksunkara)ter?Whatisyourgithubusername?(pksunkara)term?Whatisyourgithubusername?(pksunkara)terma?Whatisyourgithubusername?(pksunkara)termap?Whatisyourgithubusername?(pksunkara)termapp?Whatisyourgithubusername?(pksunkara)termappsenquirerinput-m"Whatisyourgithubusername?"-d$USERenquirerinput-m"Whatisyourgithubusername?"-d$USER diff --git a/src/theme.rs b/src/theme.rs index c491f87..93d240e 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -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(), };