diff options
author | typebrook <typebrook@gmail.com> | 2020-05-17 14:30:25 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-05-17 14:30:25 +0800 |
commit | d78e052d8ce4d24054a073c47c0bf8716c420e0d (patch) | |
tree | 70e9b87562bcbb252312bb3062604fe43f141959 | |
parent | ee801613ab7d72dcd760449a10585cd7bb33a1ef (diff) |
Get only one chractor in y/n input
-rwxr-xr-x | gist | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |