added clarity on completing a 'write'

added some comments and info in the readme regarding how to complete (or exit) a 'write'
This commit is contained in:
Mike Oertli 2022-08-05 06:48:31 -06:00 committed by Maas Lalani
parent 60ceeff5dc
commit 89f2928571
2 changed files with 6 additions and 3 deletions

View file

@ -61,7 +61,7 @@ gum input --placeholder "Summary of this change"
Prompt for a detailed (multi-line) explanation of the changes: Prompt for a detailed (multi-line) explanation of the changes:
```bash ```bash
gum write --placeholder "Details of this change" gum write --placeholder "Details of this change (CTRL+D to finish)"
``` ```
Prompt for a confirmation before committing: Prompt for a confirmation before committing:
@ -83,7 +83,7 @@ test -n "$SCOPE" && SCOPE="($SCOPE)"
# Pre-populate the input with the type(scope): so that the user may change it # Pre-populate the input with the type(scope): so that the user may change it
SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this change") SUMMARY=$(gum input --value "$TYPE$SCOPE: " --placeholder "Summary of this change")
DESCRIPTION=$(gum write --placeholder "Details of this change") DESCRIPTION=$(gum write --placeholder "Details of this change (CTRL+D to finish)")
# Commit these changes # Commit these changes
gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION" gum confirm "Commit changes?" && git commit -m "$SUMMARY" -m "$DESCRIPTION"
@ -184,6 +184,8 @@ gum input --password > password.text
Prompt for some multi-line text. Prompt for some multi-line text.
Note: `CTRL+D` is used to complete text entry. `CTRL+C` and `esc` will cancel.
```bash ```bash
gum write > story.text gum write > story.text
``` ```
@ -368,7 +370,7 @@ prefix for your commit message.
```bash ```bash
git commit -m "$(gum input --width 50 --placeholder "Summary of changes")" \ git commit -m "$(gum input --width 50 --placeholder "Summary of changes")" \
-m "$(gum write --width 80 --placeholder "Details of changes")" -m "$(gum write --width 80 --placeholder "Details of changes (CTRL+D to finish)")"
``` ```
#### Open files in your `$EDITOR` #### Open files in your `$EDITOR`

View file

@ -3,6 +3,7 @@
// //
// It can be used to ask the user to write some long form of text (multi-line) // It can be used to ask the user to write some long form of text (multi-line)
// input. The text the user entered will be sent to stdout. // input. The text the user entered will be sent to stdout.
// Text entry is completed with CTRL+D and aborted with CTRL+C or Escape.
// //
// $ gum write > output.text // $ gum write > output.text
package write package write