aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 68f92a8..ef6734a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -48,3 +48,16 @@ get_input(const char *prompt, char *buf, size_t len)
return 0;
}
+
+bool
+y_or_n(const char *prompt)
+{
+ int ch;
+
+ werase(status_window->win);
+ mvwprintw(status_window->win, 0, 0, "%s (y or n)", prompt);
+ wrefresh(status_window->win);
+ ch = getch();
+
+ return ch == 'y';
+}