initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / doc / Doxygen / tools / find-its
blob2276183628256053140cfe5a44137fe187b08847
1 #!/usr/bin/perl -w
2 use strict;
3 use File::Find ();
5 # -----------------------------------------------------------------------------
7 # Script
8 # find-its
10 # Description
11 # Search for *.[CH] files with "it's"
12 # This contraction (== "it is") looks too much like "its" (possesive)
13 # and confuses non-native (and some native) English speakers.
15 # - print filename and lineNumber
17 # -----------------------------------------------------------------------------
19 my $re_filespec = qr{^.+\.[CH]$};
21 # for the convenience of &wanted calls, including -eval statements:
22 ## use vars qw( *name *dir *prune );
23 ## *name = *File::Find::name;
24 ## *dir = *File::Find::dir;
25 ## *prune = *File::Find::prune;
27 sub wanted {
28 unless ( lstat($_) and -f _ and -r _ and not -l _ and /$re_filespec/ ) {
29 return;
32 local @ARGV = $_;
33 while (<>) {
34 if (m{it\'s}) {
35 print "$File::Find::name line=$.\n";
39 close ARGV;
42 ## Traverse desired filesystems
43 for my $dir (@ARGV) {
44 no warnings 'File::Find';
45 warn "(**) checking '$dir' ...\n";
46 File::Find::find( { wanted => \&wanted }, $dir );