summaryrefslogtreecommitdiff
path: root/libui.sh
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2010-04-04 14:06:36 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2010-04-04 14:06:36 +0200
commitac213ae1364cad272ac9bbebc1c29c0380da7047 (patch)
tree69bf392c8722c7cd120e8fc3459291da0a3da540 /libui.sh
parent5dd2b063e4ce1758d38020fa80210ac79451c0ed (diff)
fix argument checking in debug()
Diffstat (limited to 'libui.sh')
-rw-r--r--libui.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/libui.sh b/libui.sh
index a85b025..8266bee 100644
--- a/libui.sh
+++ b/libui.sh
@@ -131,11 +131,12 @@ log ()
debug ()
{
[ "$LIBUI_DEBUG" = "1" ] || return;
+ [ -n "$1" ] || die error "you must specify at least one (non-empty) debug category"
+ [ -n "$2" ] || die_error "debug \$2 cannot be empty"
for cat in $1
do
check_is_in $cat "${LIBUI_DEBUG_CATEGORIES[@]}" || die_error "debug \$1 contains a value ($cat) which is not a valid debug category"
done
- [ -n "$2" ] || die_error "debug \$2 cannot be empty"
for file in "${LIBUI_LOG_FILE[@]}"; do
dir=$(dirname $file)
mkdir -p $dir || die_error "Cannot create log directory $dir"