Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/util/term.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/term.sh')
-rw-r--r--src/lib/util/term.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/util/term.sh b/src/lib/util/term.sh
index 853dccf..08d044f 100644
--- a/src/lib/util/term.sh
+++ b/src/lib/util/term.sh
@@ -180,3 +180,19 @@ term_spinner_stop() {
# show the cursor after stopping the spinner
term_cursor_show
}
+
+prompt() {
+ local message=$1
+ local answer
+
+ read -r -p "${message} (y/N) " answer
+
+ case "${answer}" in
+ y|Y|yes|Yes|YES)
+ true
+ ;;
+ *)
+ false
+ ;;
+ esac
+}