Remove '()' decoration from $caller internal variable. Decorations are
matter of presentations; at this level the brackets are only confusing.
To decide whether a caller is main script or direct descendant thereof,
called main(), use negative index of the stack array FUNCNAME (0 in first
case, 1 in the second). To signal that to the `_pretty_*` plug-ins,
use a dedicated boolean.
This also accounts for cases when a main() function is declared somewhere
else than in the main binary. Older code would simply assume (based
on the name being "main") that it's called from main binary and rewrite
$caller, possibly causing confusion. Now, only the originally intended
special cases behave specially.
This is simply impossible; debug_pipe is wrapper around debug which is
identified soon enough, so "debug_pipe" can't be assigned to $frontend.
Also, _pretty__get_frontend() will never return bracket-decorated
function name.
Do not exclude empty lines when debugging with debug_pipe
The grep throws away all empty lines, no matter if SHELLFU_DEBUG is on
or not.
This seems as terrible idea and I can't find out what wass the reason for
that. (I wonder why everything is not broken due to this; most probably
because nobody really uses debug_pipe.)
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.
It's rather useless in load-time, since the environment is often
tailored since then (e.g. SHELLFU_PATH is the most obvious example).
By far most realistic use case is import; even those related sub-commands
are always used along with import anyway.
pretty.sh assumes that mkusage is always called from a function named
`usage()` and manipulates $caller based on that. For subcommands,
though, the convention is based on name of the binary anyway, so we can
easily circumvent that limitation.
* Added ability to mute debug output per module and/or function
* Renamed shellfudoc for consistency with rest
* Improved docs
* Improved Test suite
* Improved packaging