Skip to content

Debugging

The --log-verbose flag logs script comments and command executions to stderr:

Terminal window
lash script.lash --log-verbose
EventFormat
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.

The --log-variables flag logs variable mutations to stderr. An optional comma-separated name filter limits output to specific variables:

Terminal window
lash script.lash --log-variables # all variable changes
lash script.lash --log-variables x,y # only x and y
EventFormat
Declaration[var] let name = value
Assignment[var] name = value
Drop[var] drop name

Flags can be combined. All debug output goes to stderr, so it doesn’t interfere with script output:

Terminal window
lash script.lash --log-verbose --log-variables x,count

Combine with --test to see test names printed before execution:

Terminal window
lash script.lash --test --log-verbose

Each unittest block’s preceding comment is printed as [debug] # comment text before the test runs.

For interactive debugging with breakpoints and variable inspection, see Debug Adapter (DAP).