7 use List
::Util
qw(min);
13 'xx-uncategorized' => {},
18 my $re = join '|', keys %search;
22 find
(\
&wanted
, (shift @ARGV) || '.');
25 if (m/\.(?:svn|git)\b/) {
26 $File::Find
::prune
= 1;
29 return unless m/\.t$/;
30 my $n = $File::Find
::name
;
33 open (my $h, '<', $_) or die "Can't open '$_': $!";
37 if ($f =~ m/plan\s+(\d+)/){
45 $search{$1}{plan
} += $plan;
47 $search{other
}{files
}++;
48 $search{other
}{plan
} += $plan;
49 push @others, [$plan, $n];
53 print " Category Files Plan\n";
54 print "---------------------------------\n";
55 for (sort keys %search) {
56 printf "%18s %5d %6d\n", $_, $search{$_}{files
}, $search{$_}{plan
};
60 @others = reverse sort { $a->[0] <=> $b->[0] } @others;
61 for (0..min
(12, $#others)) {
62 printf "%4d %s\n", $others[$_]->[0], $others[$_]->[1];
65 #print Dumper \%search;