From 3da75d2e7bfce5e4f9f4732fe96c5facfc54bfc2 Mon Sep 17 00:00:00 2001 From: Devin Teske Date: Mon, 7 Jan 2013 00:15:52 +0000 Subject: [PATCH] Add nonInteractive support to f_dialog_yesno/noyes(). --- usr.sbin/bsdconfig/share/dialog.subr | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr index f614be26d8a..ead0d3c7953 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" \