Przeglądaj źródła

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 lat temu
rodzic
commit
1b007f4cf6
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2
    2
      src/include/pretty.sh

+ 2
- 2
src/include/pretty.sh Wyświetl plik

@@ -311,10 +311,10 @@ _pretty__echo() {
311 311
     local provider  # which provider (_pretty__echo_*()) to use
312 312
     frontend="$(_pretty__get_frontend)" || exit_usage
313 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 316
     test "$caller"   == "main()"        && caller="$(basename "$0")"
316 317
     test "$caller"   == "usage()"       && frontend=mkusage
317
-    test "$frontend" == "debug_pipe()"  && frontend=debug
318 318
     while true; do case $1 in
319 319
         -c|--cmd)   provider=cmd;   shift; break ;;
320 320
         -f|--files) provider=files; shift; break ;;