ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / doc / tools / find-placeholderDescription
blobd22fe5f72f832f6ebd76539c29fbaee42377d6aa
1 #!/usr/bin/perl -w
2 use strict;
3 use File::Find ();
5 # -----------------------------------------------------------------------------
7 # Script
8 # find-placeholderDescription
10 # Description
11 # Search for *.[H] files with a Description that looks like it is
12 # a placeholder
13 # eg, Foam::className
15 # - print filename '#' and the description
17 # -----------------------------------------------------------------------------
19 my $minLength = 16;
20 my $re_filespec = qr{^.+\.[H]$};
22 # for the convenience of &wanted calls, including -eval statements:
23 ## use vars qw( *name *dir *prune );
24 ## *name = *File::Find::name;
25 ## *dir = *File::Find::dir;
26 ## *prune = *File::Find::prune;
28 sub wanted {
29 unless ( lstat($_) and -f _ and -r _ and not -l _ and /$re_filespec/ ) {
30 return;
33 my ( $tag, $description );
35 local @ARGV = $_;
36 while (<>) {
37 my $name;
39 ## examine the class/typedef name
40 if (/^(Class|Typedef)\s*$/) {
41 $_ = <>;
42 ($tag) = split;
44 if (/^Description\s*$/) {
45 $_ = <>;
46 ( $description = $_ ) =~ s{^\s+|\s+$}{}g;
48 # remove trailing punctuation as being noise
49 $description =~ s{\s*[.,:]+$}{};
50 last;
54 $description ||= '';
56 ## we have 'Class/Typedef' tag
57 if ( defined $tag ) {
58 # description looks like a class name
59 if (
60 $description =~ m{^\w+(::\w+)+$}
61 ) {
62 print "$File::Find::name # $description\n";
67 ## Traverse desired filesystems
68 for my $dir (@ARGV) {
69 no warnings 'File::Find';
70 warn "(**) checking '$dir' ...\n";
71 File::Find::find( { wanted => \&wanted }, $dir );