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:
authorAndreas Baumann <mail@andreasbaumann.cc>2024-08-16 08:06:08 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2024-08-16 08:06:08 +0200
commitdeffc1b87e86fffa8e4758a76a1912c6c8f69a85 (patch)
tree0f61a152c4c49d40de5042df2b25cdb8e0b0a82d /src/lib/util/term.sh
parent2994bca96781afd62104c1515532a9c479cb5bed (diff)
parent27eebe383d0b571c08cba991e4824768d7623602 (diff)
merged with upstreamHEADmaster
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
+}