In the next release of xmlsh (ETA end of may), there is a significant improvement to error diagnostics. This effects normal function errors, as well as the -v and -x options.
All command errors that cause a usage or exception, as well as -v and -x output
produces file/line diagnostics.
$ echo -foo
[stdin line: 1]
echo: Unknown option: foo
In scripts this includes the filename of the script and line number.
This output is also in -v and -x output (preceeding the function)
$ set -v -x
$ echo foo
- [stdin line: 7]
+ [stdin line: 7]