summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share/dialog.subr
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-10-09 08:12:26 +0000
committerdteske <dteske@FreeBSD.org>2013-10-09 08:12:26 +0000
commitee2fafc6a903bcdb2569fc1d6c3ffce0f14c3ebd (patch)
tree4b1792e416c982abbc7d554b2fb8ab80ba5afb91 /usr.sbin/bsdconfig/share/dialog.subr
parent255d648aec920f8660ba18ef659a9a08f5ee0198 (diff)
downloadFreeBSD-src-ee2fafc6a903bcdb2569fc1d6c3ffce0f14c3ebd.zip
FreeBSD-src-ee2fafc6a903bcdb2569fc1d6c3ffce0f14c3ebd.tar.gz
Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-use
throughout the bsdconfig(8) code. While we're here, add an explicit argument to lvalue-seeking invocations of "return" that previously had no argument. Also, consolidate a single instance of double-newline and remove some comments that are no longer required (given increased readability with new exit codes). Approved by: re (glebius)
Diffstat (limited to 'usr.sbin/bsdconfig/share/dialog.subr')
-rw-r--r--usr.sbin/bsdconfig/share/dialog.subr12
1 files changed, 12 insertions, 0 deletions
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index bde3753..ff7fc86 100644
--- a/usr.sbin/bsdconfig/share/dialog.subr
+++ b/usr.sbin/bsdconfig/share/dialog.subr
@@ -74,6 +74,18 @@ unset XDIALOG_FORCE_AUTOSIZE
unset XDIALOG_INFOBOX_TIMEOUT
#
+# Exit codes for [X]dialog(1)
+#
+DIALOG_OK=${SUCCESS:-0}
+DIALOG_CANCEL=${FAILURE:-1}
+DIALOG_HELP=2
+DIALOG_ITEM_HELP=2
+DIALOG_EXTRA=3
+DIALOG_ITEM_HELP=4
+export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1'
+DIALOG_ESC=255
+
+#
# Default behavior is to call f_dialog_init() automatically when loaded.
#
: ${DIALOG_SELF_INITIALIZE=1}
OpenPOWER on IntegriCloud