| 4 |
## $Id$ |
## $Id$ |
| 5 |
## ------------------------------------------------------------------------ |
## ------------------------------------------------------------------------ |
| 6 |
## $Log$ |
## $Log$ |
| 7 |
|
## Revision 1.3 2003/02/01 06:41:21 joko |
| 8 |
|
## + added mechanism using option 'regex-exclude' |
| 9 |
|
## |
| 10 |
## Revision 1.2 2003/02/01 02:52:32 joko |
## Revision 1.2 2003/02/01 02:52:32 joko |
| 11 |
## + minor update |
## + minor update |
| 12 |
## |
## |
| 32 |
- finder.pl --regex=/CVS/Root$ /tmp/cvsroot |
- finder.pl --regex=/CVS/Root$ /tmp/cvsroot |
| 33 |
finds all files/directories matching 'regex' in path '/tmp/cvsroot' and below (recursively) |
finds all files/directories matching 'regex' in path '/tmp/cvsroot' and below (recursively) |
| 34 |
|
|
| 35 |
|
- todo: |
| 36 |
|
x exclude mechanism (use regex-exclude) |
| 37 |
|
o remember all matched entries while processing, show at end of processing in report |
| 38 |
|
o add some statistics (count-matched/count-all) |
| 39 |
|
|
| 40 |
=cut |
=cut |
| 41 |
|
|
| 42 |
|
|
| 63 |
|
|
| 64 |
sub wanted { |
sub wanted { |
| 65 |
my $pattern = $settings->{options}->{regex}; |
my $pattern = $settings->{options}->{regex}; |
| 66 |
|
my $pattern_exclude = $settings->{options}->{'regex-exclude'}; |
| 67 |
#print "pattern: $pattern", "\n"; |
#print "pattern: $pattern", "\n"; |
| 68 |
if ($File::Find::name =~ m/$pattern/) { |
if ($File::Find::name =~ m/$pattern/) { |
| 69 |
|
if ($pattern_exclude && $File::Find::name =~ m/$pattern_exclude/) { |
| 70 |
|
return; |
| 71 |
|
} |
| 72 |
print $File::Find::name, "\n"; |
print $File::Find::name, "\n"; |
| 73 |
#replaceInFile($File::Find::name); |
#replaceInFile($File::Find::name); |
| 74 |
#exit; |
#exit; |