tasty revision to load feisty for full use
[feisty_meow.git] / scripts / buildor / find_one_word_comments.sh
1 #!/bin/bash
2 # this finds any one-word commented items, which are often a sign of a formal
3 # parameter that was commented out because it's unused.  that's a suboptimal
4 # way to fix the compiler warning for some people, and so this will find any
5 # occurrences of the "wrong"ish way.
6 # (one different way that some think is more optimal is to use the formal()
7 # macro to hide the function definition.)
8
9 SOURCES_FOUND_LIST="$(mktemp "$TMP/sources_found.XXXXXX")"
10
11 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
12 source $FEISTY_MEOW_SCRIPTS/buildor/seek_all_source.sh $*
13   # got a list of source files now.
14
15 function examine_file {
16   file="$1"
17   matches="$(sed -n -e 's/\/\*[a-z_A-Z][a-z_A-Z0-9]*\*\//yo/p' <"$file")"
18   if [ ! -z "$matches" ]; then echo "$file"; fi
19 }
20
21 while read line_found; do
22   if [ $? != 0 ]; then break; fi
23   examine_file "$line_found"
24 done <"$SOURCES_FOUND_LIST"
25
26 rm "$SOURCES_FOUND_LIST"
27