log the current file / operation during execeution of a script
When we execute a script (e.g. one generated by
export), there is no output that helps us understand where in the script we currently are. This is particularly problematic in case something goes wrong (error/exception), where the backtrace might not give us an indication of the EF that was currently selected.
One can enable
set apdu_trace true and then check back from the FID of the last SELECT (A4) to the filename manually, but that's cumbersome and just a hack.
I think when executing a script, we should give a brief log of what we're doing, such as simply echoing the script line to stdout.
export with explicit
echo statements not a solution, as that wouldn't work for other scripts (not generated by
I wonder if the "set echo true" would help. When echo is set to true, then CMD2 would print every command line that is executed. We even see the prompt, so we also get to know the current path and channel. I found this in the CMD2 documentation (https://cmd2.readthedocs.io/en/latest/features/initialization.html) under section "Public instance attributes".