#!/bin/bash
perl -ne 'print unless /^\d+\t\Q$ENV{c}\E/' |
chatgpt_process "Please read this code with numbered lines, and reply with a numbered list of $comments $purpose for $dev.
Only give comments for the confusing parts, preferably not for every line.
You can comment on a range of lines like this: <start>-<end>. <the comment>" |
perl -pe 's/^\s*([0-9\s-]+)[.:]?\s*/$1\t\n$1\t'"$c "'/' | # clean up the line numbers and add a blank line above each comment
sed '1 { /^$/d; }'
