From a9902d71f1bc72006d2ed2ee6422bfd001e12646 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 18 Aug 2010 16:17:04 +0200 Subject: libui_sh_init: validate requested UI type --- libui.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libui.sh b/libui.sh index 8f6ede3..11f6865 100644 --- a/libui.sh +++ b/libui.sh @@ -15,6 +15,8 @@ libui_sh_init () { LIBUI_UI=${1:-cli} + allowed_uis=('cli' 'dia') + check_is_in "$LIBUI_UI" "${allowed_uis[@]}" || die_error "libui_sh_init \$1 must be one of 'cli', 'dia' or '' (for cli)" [ "$LIBUI_UI" == 'dialog' ] && ! which dialog &>/dev/null && die_error "Required dependency dialog not found" LIBUI_TMP_DIR=/tmp if [ -n "$2" ]; then -- cgit v1.2.2