summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-01-07 00:15:52 +0000
committerdteske <dteske@FreeBSD.org>2013-01-07 00:15:52 +0000
commitb9b77b44df8e5a5813d5488e0d9e74a64b455cb3 (patch)
tree6c411741d5c254ba03f4be42e0c5e9df28fbd7f7 /usr.sbin/bsdconfig/share
parent97e76936ec964af173aff961044216c92d94a32a (diff)
downloadFreeBSD-src-b9b77b44df8e5a5813d5488e0d9e74a64b455cb3.zip
FreeBSD-src-b9b77b44df8e5a5813d5488e0d9e74a64b455cb3.tar.gz
Add nonInteractive support to f_dialog_yesno/noyes().
Diffstat (limited to 'usr.sbin/bsdconfig/share')
-rw-r--r--usr.sbin/bsdconfig/share/dialog.subr7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index f614be2..ead0d3c 100644
--- a/usr.sbin/bsdconfig/share/dialog.subr
+++ b/usr.sbin/bsdconfig/share/dialog.subr
@@ -32,6 +32,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
f_dprintf "%s: loading includes..." dialog.subr
f_include $BSDCFG_SHARE/strings.subr
+f_include $BSDCFG_SHARE/variable.subr
BSDCFG_LIBE="/usr/libexec/bsdconfig"
f_include_lang $BSDCFG_LIBE/include/messages.subr
@@ -1058,6 +1059,9 @@ f_dialog_yesno()
{
local msg_text="$*"
local hline="$hline_arrows_tab_enter"
+
+ f_interactive || return 0 # If non-interactive, return YES all the time
+
local size="$( f_dialog_buttonbox_size \
"$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" \
@@ -1098,6 +1102,9 @@ f_dialog_noyes()
{
local msg_text="$*"
local hline="$hline_arrows_tab_enter"
+
+ f_interactive || return 1 # If non-interactive, return NO all the time
+
local size="$( f_dialog_buttonbox_size \
"$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" \
OpenPOWER on IntegriCloud