todos.md
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๐
#!/bin/bash
# TODO: handle spaces in names
echo "$1"
# TODO: and newlines
Lines are numbered from one.
/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.
notes:
TODO: indented with a tab
\TODO: with a backslash
/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.
all done here
examples/todos.md ยท 1.0 KiB ยท 29dc7c3cab