From 89f2928571239469a68999f74a444032c9fff10e Mon Sep 17 00:00:00 2001 From: Mike Oertli Date: Fri, 5 Aug 2022 06:48:31 -0600 Subject: [PATCH] added clarity on completing a 'write' added some comments and info in the readme regarding how to complete (or exit) a 'write' --- README.md | 8 +++++--- write/write.go | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3408c0e..295ba72 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ gum input --placeholder "Summary of this change" Prompt for a detailed (multi-line) explanation of the changes: ```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: @@ -83,7 +83,7 @@ test -n "$SCOPE" && SCOPE="($SCOPE)" # 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") -DESCRIPTION=$(gum write --placeholder "Details of this change") +DESCRIPTION=$(gum write --placeholder "Details of this change (CTRL+D to finish)") # Commit these changes 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. +Note: `CTRL+D` is used to complete text entry. `CTRL+C` and `esc` will cancel. + ```bash gum write > story.text ``` @@ -368,7 +370,7 @@ prefix for your commit message. ```bash 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` diff --git a/write/write.go b/write/write.go index 41aa988..9b43100 100644 --- a/write/write.go +++ b/write/write.go @@ -3,6 +3,7 @@ // // 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. +// Text entry is completed with CTRL+D and aborted with CTRL+C or Escape. // // $ gum write > output.text package write