Debugging
Verbose Logging
Section titled “Verbose Logging”The --log-verbose flag logs script comments and command executions to stderr:
lash script.lash --log-verbose| Event | Format |
|---|---|
| Comment | [debug] # comment text |
| Pipeline | [exec] program args | program args |
Pipeline commands are logged after variable expansion, so you see the actual values passed to each command.
Variable Tracing
Section titled “Variable Tracing”The --log-variables flag logs variable mutations to stderr. An optional comma-separated name filter limits output to specific variables:
lash script.lash --log-variables # all variable changeslash script.lash --log-variables x,y # only x and y| Event | Format |
|---|---|
| Declaration | [var] let name = value |
| Assignment | [var] name = value |
| Drop | [var] drop name |
Combining Flags
Section titled “Combining Flags”Flags can be combined. All debug output goes to stderr, so it doesn’t interfere with script output:
lash script.lash --log-verbose --log-variables x,countWith Unit Tests
Section titled “With Unit Tests”Combine with --test to see test names printed before execution:
lash script.lash --test --log-verboseEach unittest block’s preceding comment is printed as [debug] # comment text before the test runs.
Debug Adapter Protocol
Section titled “Debug Adapter Protocol”For interactive debugging with breakpoints and variable inspection, see Debug Adapter (DAP).