2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 # Use: find_files.pl <start-from> [exclude-dir ...]
12 my $progname = basename($0);
14 my $root_dir = shift @ARGV;
17 my $path = shift @ARGV;
18 push @find_args, qw'-not ( -path', "*/$path/*", qw'-prune )'
20 push @find_args, qw(-follow -type f -print);
22 open FIND, '-|', 'find', $root_dir, @find_args
23 or die "$progname: Couldn't exec find: $!\n";
24 my $check_regex = '\.(asm|c(c|pp|xx)?|h(h|pp|xx)?|p(l|m)|xs|sh|php|py(|x)' .
25 '|rb|idl|java|el|sc(i|e)|cs|pas|inc|js|pac|html|dtd|xsl|mod|mm?' .
30 print "$_\n" unless (-z $_ || !m%$check_regex%);