FIX: New a2x (since 8.6.7) options in doxyToX.py
[freefoam.git] / data / utilities / findBogusClassDoc
blobe2c3b2f2c96256b4eec20c6adf955d3042fc32aa
1 #!/bin/sh
2 #------------------------------------------------------------------------------
3 # ______ _ ____ __ __
4 # | ____| _| |_ / __ \ /\ | \/ |
5 # | |__ _ __ ___ ___ / \| | | | / \ | \ / |
6 # | __| '__/ _ \/ _ ( (| |) ) | | |/ /\ \ | |\/| |
7 # | | | | | __/ __/\_ _/| |__| / ____ \| | | |
8 # |_| |_| \___|\___| |_| \____/_/ \_\_| |_|
10 # FreeFOAM: The Cross-Platform CFD Toolkit
12 # Copyright (C) 2008-2012 Michael Wild <themiwi@users.sf.net>
13 # Gerber van der Graaf <gerber_graaf@users.sf.net>
14 #------------------------------------------------------------------------------
15 # License
16 # This file is part of FreeFOAM.
18 # FreeFOAM is free software: you can redistribute it and/or modify it
19 # under the terms of the GNU General Public License as published by the
20 # Free Software Foundation, either version 3 of the License, or (at your
21 # option) any later version.
23 # FreeFOAM is distributed in the hope that it will be useful, but WITHOUT
24 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
25 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 # for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with FreeFOAM. If not, see <http://www.gnu.org/licenses/>.
31 # Script
32 # findBogusClassDoc
34 # Description
35 # Finds files with wrong class documentation comments.
37 # Bugs
38 # Reports quite a number of false positives (e.g. if the class name is
39 # wrapped)
40 #------------------------------------------------------------------------------
42 usage() {
43 exec 1>&2
44 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
45 cat<<USAGE
46 Usage: ${0##*/} [-h|-help] dir1 [dir2 .. dirN]
48 Finds files with wrong class documentation comments.
50 USAGE
51 exit 1
54 # parse options
55 while [ "$#" -gt 0 ]
57 case "$1" in
58 -h | -help)
59 usage
61 -*)
62 usage "unknown option: '$*'"
65 break
67 esac
68 done
70 if [ $# -lt 1 ]; then
71 usage "At least one directory name required"
74 grep -rI -A1 --include '*.[CH]' --exclude '*/lnInclude/*' '^Class\s*$' $@ | \
75 awk -F- '/\.[CH]-/{print $1 $2;}' | \
76 while read f c; do
77 c=${c##*::}
78 grep -q "^class $c\$" $f || echo $f
79 done