Child execution debug printing tracing/hooks
andrewchambers opened this issue · comments
andrewchambers commented
I recently wanted to print out all the commands a script was executing (A C build script) - It was very hard to do so, In bash you do something like:
verbose () {
echo "$@"
"$@"
}
verbose cc foo.c ...
In janet I am not sure the right approach, but perhaps a dynamic variable that can be set to control a debug callback then users can define a macro like 'with-verbose'
(with-verbose (do (sh/$ cc ...) (sh/$ cc ...) (sh/$ cc ...)))
An alternative is to integrate with the janet vm trace functions by providing a clear trace point.