diff options
author | Michael Kerrisk <mtk.manpages@gmail.com> | 2006-07-11 04:45:50 +0000 |
---|---|---|
committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2006-07-11 04:45:50 +0000 |
commit | d7ad251c0cf9cfba051b6aac67e5f98c84b9fb07 (patch) | |
tree | c25a6b2f4788a290d6c7c995ed9667dfc77b073f /scripts | |
parent | ad47ce550cb182ae5229b55432fc8fbbdd1a521b (diff) | |
download | man-pages-d7ad251c0cf9cfba051b6aac67e5f98c84b9fb07.tar.gz |
A script that displays FIXMEs in the man page source files
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/show_FIXMES.sh | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/scripts/show_FIXMES.sh b/scripts/show_FIXMES.sh new file mode 100644 index 0000000000..e72af12cd9 --- /dev/null +++ b/scripts/show_FIXMES.sh @@ -0,0 +1,76 @@ +#!/bin/sh +# show_FIXMES.sh +# +# Display FIXME segments from man-pages source files +# + +show_all="n" +while getopts "a" optname; do + case "$optname" in + + a) # "all" + # Even show FIXMEs that aren't generally interesting. (Typically + # these FIXMEs are notes to the maintainer to reverify something + # at a future date.) + + show_all="y" + ;; + + *) echo "Unknown option: $OPTARG" + exit 1 + ;; + + esac +done + +shift $(( OPTIND - 1 )) + +if test $# -eq 0; then + echo "Usage: $0 [-a] pathname" 1>&2 + exit 1; +fi + +for page in $(find $1 -type f -name '*.[1-9]' \ + -exec grep -l FIXME {} \; | sort) +do + cat $page | awk -v SHOW_ALL=$show_all -v PAGE_NAME=$page ' + BEGIN { + page_FIXME_cnt = 0; + } + + /FIXME/ { + + # /.\" FIXME . / ==> do not display this FIXME, unless + # -a command-line option was supplied + + if (!($0 ~ /^\.\\\" FIXME \./ ) || SHOW_ALL == "y") { + if (page_FIXME_cnt == 0) { + print "=========="; + print PAGE_NAME; + } + page_FIXME_cnt++; + + finished = 0; + do { + print $0; + + # Implicit end of FIXME is end-of-file or a line + # that is not a comment + + if (getline == 0) + finished = 1; + + if (!($0 ~ /^.\\\"/)) + finished = 1; + + # /.\" .$/ ==> Explicit end of FIXME + + if ($0 ~ /^.\\\" \.$/) + finished = 1; + } while (!finished); + + print ""; + } + } + ' +done | sed -e 's/^\.\\"/ /' | sed -e 's/ *$//' | cat -s |