aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-05-17 14:30:25 +0800
committertypebrook <typebrook@gmail.com>2020-05-17 14:30:25 +0800
commitd78e052d8ce4d24054a073c47c0bf8716c420e0d (patch)
tree70e9b87562bcbb252312bb3062604fe43f141959
parentee801613ab7d72dcd760449a10585cd7bb33a1ef (diff)
Get only one chractor in y/n input
-rwxr-xr-xgist4
1 files changed, 2 insertions, 2 deletions
diff --git a/gist b/gist
index fe3ee42..c65fb00 100755
--- a/gist
+++ b/gist
@@ -530,9 +530,9 @@ _goto_gist_by_index() {
530# Specify --force to suppress confirmation 530# Specify --force to suppress confirmation
531_delete_gist() { 531_delete_gist() {
532 if [[ ! $* =~ '--force' ]]; then 532 if [[ ! $* =~ '--force' ]]; then
533 read -r -p "Delete gists above? [y/N] " response 533 read -n1 -p "Delete gists above? [y/N] " response
534 response=${response,,} 534 response=${response,,}
535 [[ ! $response =~ ^(yes|y)$ ]] && return 0 535 [[ ! $response =~ ^(y|Y)$ ]] && return 0 || echo
536 fi 536 fi
537 537
538 for i in "$@"; do 538 for i in "$@"; do