1
0
镜像自地址 https://github.com/mail-in-a-box/mailinabox.git 已同步 2026-03-17 17:57:23 +01:00

Add a Yes/No function

这个提交包含在:
dkoao
2019-09-26 22:34:54 +00:00
父节点 8984180787
当前提交 7160d3c6a5

查看文件

@@ -158,6 +158,17 @@ function message_box {
dialog --title "$1" --msgbox "$2" 0 0 dialog --title "$1" --msgbox "$2" 0 0
} }
function yesno_box {
# yesno_box "title" "prompt" VARIABLE
# The exit code resembles the user's input and will be stored in the variable VARIABLE
# Temporarily turn off 'set -e' because we need the dialog return code
declare -n result=$3
set +e
dialog --stdout --title "$1" --yesno "$2" 0 0
result=$?
set -e
}
function input_box { function input_box {
# input_box "title" "prompt" "defaultvalue" VARIABLE # input_box "title" "prompt" "defaultvalue" VARIABLE
# The user's input will be stored in the variable VARIABLE. # The user's input will be stored in the variable VARIABLE.