5 # Display FIXME segments from man-pages source files
7 # (C) Copyright 2007 & 2013, Michael Kerrisk
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details
17 # (http://www.gnu.org/licenses/gpl-2.0.html).
19 ######################################################################
21 # (C) Copyright 2006 & 2013, Michael Kerrisk
22 # This program is free software; you can redistribute it and/or
23 # modify it under the terms of the GNU General Public License
24 # as published by the Free Software Foundation; either version 2
25 # of the License, or (at your option) any later version.
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details
31 # (http://www.gnu.org/licenses/gpl-2.0.html).
36 while getopts "a" optname
; do
40 # Even show FIXMEs that aren't generally interesting. (Typically
41 # these FIXMEs are notes to the maintainer to reverify something
47 *) echo "Unknown option: $OPTARG"
54 shift $
(( $OPTIND - 1 ))
56 if test $# -eq 0; then
57 echo "Usage: $0 [-a] pathname..." 1>&2
62 for page
in $
(find "$dir" -type f
-name '*.[1-9]' \
63 -exec grep -l FIXME
{} \
; |
sort)
65 cat "$page" |
awk -v SHOW_ALL
=$show_all -v PAGE_NAME
="$page" \
73 # /.\" FIXME . / ==> do not display this FIXME, unless
74 # -a command-line option was supplied
76 if ($0 ~ /^\.\\" FIXME \./ )
78 else if ($0 ~ /^\.\\" FIXME *\?/ )
79 FIXME_type = "question"
81 FIXME_type = "normal";
82 if (FIXME_type == "normal" || SHOW_ALL == "y") {
83 if (page_FIXME_cnt == 0) {
93 # Implicit end of FIXME is end-of-file or a line
94 # that is not a comment
102 # /.\" .$/ ==> Explicit end of FIXME
104 if ($0 ~ /^.\\" \.$/)
112 done |
sed -e 's/^\.\\"/ /' |
sed -e 's/ *$//' |
cat -s