todo 594 B

12345678910111213141516171819202122232425262728293031
  1. #! /bin/bash
  2. #
  3. # List "TODO" and "XXX" items in the given files, or throughout the source
  4. # code.
  5. set -e -u -o pipefail
  6. # TODO: Make location-independent?
  7. find_source() {
  8. echo configure.ac
  9. find . -name \*.cxx -o -name \*.hxx | sed -e 's|^\./||' | sort
  10. for f in $(ls tools)
  11. do
  12. echo tools/$f
  13. done
  14. }
  15. FILES=${*:-$(find_source)}
  16. # Search for "$1:" in files $2.
  17. # (This function adds the colon. That way, the search statement itself won't
  18. # show up in the search.)
  19. search_for() {
  20. grep $1: $2
  21. }
  22. search_for XXX "$FILES" || true
  23. search_for TODO "$FILES" || true