From 320b62c8bcb36db3a6ed69b61224b8fdf2e22606 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Mon, 15 Jun 2015 14:17:44 +0200 Subject: [PATCH] Other question method --- bin/git_clean | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/git_clean b/bin/git_clean index 3a2c9a1..4ac4dda 100755 --- a/bin/git_clean +++ b/bin/git_clean @@ -4,6 +4,13 @@ git clean -d -x -n echo "Continue the real cleanup of the tree? [y/N]" +read -n 1 "Continue the real cleanup of the tree (y/n)?" choice +case "$choice" in + y|Y ) echo "yes";; + n|N ) echo "no";; + * ) echo "invalid";; +esac + read -n 1 answer if (( ${#answer} && (( "$answer" == "Y" || "$answer" == "y" )) )); then