Browse Source

Do not exclude anything just if debug is on and caller fits

The exclusion criterion would be true for amy frontend just if debug
was on and the caller fit SHELLFU_DEBUG_EXCLUDE.  That is, even warnings
and thoughts from the caller would be muted!

In fact, it's frontend that matters; only debug frontend should be
considered for exclusion.  OTOH, we don't need to check SHELLFU_DEBUG as
debug frontends already give up ASAP if that is not set.

We also need to move the frontend rewrite sooner for this to work.
Alois Mahdal 9 years ago
parent
commit
1b007f4cf6
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/include/pretty.sh

+ 2
- 2
src/include/pretty.sh View File

311
     local provider  # which provider (_pretty__echo_*()) to use
311
     local provider  # which provider (_pretty__echo_*()) to use
312
     frontend="$(_pretty__get_frontend)" || exit_usage
312
     frontend="$(_pretty__get_frontend)" || exit_usage
313
     caller="$(_pretty__get_caller)"
313
     caller="$(_pretty__get_caller)"
314
-    $SHELLFU_DEBUG && _pretty__is_excluded "$caller" && return 0
314
+    test "$frontend" == "debug_pipe()"  && frontend=debug
315
+    test "$frontend" = debug && _pretty__is_excluded "$caller" && return 0
315
     test "$caller"   == "main()"        && caller="$(basename "$0")"
316
     test "$caller"   == "main()"        && caller="$(basename "$0")"
316
     test "$caller"   == "usage()"       && frontend=mkusage
317
     test "$caller"   == "usage()"       && frontend=mkusage
317
-    test "$frontend" == "debug_pipe()"  && frontend=debug
318
     while true; do case $1 in
318
     while true; do case $1 in
319
         -c|--cmd)   provider=cmd;   shift; break ;;
319
         -c|--cmd)   provider=cmd;   shift; break ;;
320
         -f|--files) provider=files; shift; break ;;
320
         -f|--files) provider=files; shift; break ;;