summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ui.sh2
-rw-r--r--src/ui/cli.sh16
2 files changed, 17 insertions, 1 deletions
diff --git a/src/ui.sh b/src/ui.sh
index 5336c5e..23f9236 100644
--- a/src/ui.sh
+++ b/src/ui.sh
@@ -29,7 +29,7 @@ init_ui()
;;
esac
- for fn in exit_ui resume_ui show_menu; do
+ for fn in exit_ui resume_ui show_menu show_prompt; do
eval "${fn}() { ${ui}_${fn} \"\${@}\"; }"
done
for fn in dbg info warn err; do
diff --git a/src/ui/cli.sh b/src/ui/cli.sh
index 3471431..2325c5b 100644
--- a/src/ui/cli.sh
+++ b/src/ui/cli.sh
@@ -95,3 +95,19 @@ cli_show_menu()
return 0
done
}
+
+cli_show_prompt()
+{
+ local title="${1}"
+ local input=''
+ shift 1
+
+ printf '%s\n' "${title}" >"${cli_tty}"
+ { printf '%s\n' "${title}" | sed 's/./-/g'; } >"${cli_tty}"
+
+ printf '\n> ' >"${cli_tty}"
+ read -r input
+ printf '\n' >"${cli_tty}"
+ printf '%s' "${input}"
+ return 0
+}