diff --git a/bin/cdist-config b/bin/cdist-config index bf3f5b24..b15d1f3e 100644 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -21,8 +21,16 @@ __cdist_version="1.8.0" -# Enable debugging -[ "$__cdist_debug" ] && set -x +# +# Enable debugging: +# +# __cdist_debug unset -> no debug +# __cdist_debug = 1 -> debug via __cdist_echo +# __cdist_debug = 2 -> debug via set -x +# + +: ${__cdist_debug:=0} +[ "$__cdist_debug" = 2 ] && set -x # Fail if something bogus is going on set -u diff --git a/core/__cdist_echo b/core/__cdist_echo index 2fcc93f0..37d24dd6 100755 --- a/core/__cdist_echo +++ b/core/__cdist_echo @@ -35,11 +35,9 @@ __cdist_echo() case "$__cdist_echo_type" in debug) - set +u - if [ "$__cdist_debug" ]; then + if [ "$__cdist_debug" = 1 ]; then echo $__cdist_echo_prefix "Debug: $@" fi - set -u ;; info) echo $__cdist_echo_prefix "$@"