todos.sh, by example ==================== `todos.sh` lists the lines of files that mention TODO, as `FILE:LINE:TEXT`. Each case below is a pair of hunks: `CASE/input` is a file's content, and `CASE/output` is what `todos.sh` prints for that file. `test-todos.sh` runs every case, handing `todos.sh` the input as `/dev/stdin`. ### the basics [testmark]:# (basic/input) ```bash #!/bin/bash # TODO: handle spaces in names echo "$1" # TODO: and newlines ``` Lines are numbered from one. [testmark]:# (basic/output) ```text /dev/stdin:2:# TODO: handle spaces in names /dev/stdin:4:# TODO: and newlines ``` ### lines come out as they are Leading whitespace and backslashes are kept. [testmark]:# (verbatim/input) ```text notes: TODO: indented with a tab \TODO: with a backslash ``` [testmark]:# (verbatim/output) ```text /dev/stdin:2: TODO: indented with a tab /dev/stdin:3: \TODO: with a backslash ``` ### nothing to do No TODOs, no output: the output hunk is empty. [testmark]:# (none/input) ```text all done here ``` [testmark]:# (none/output) ```text ```