]> git.donarmstrong.com Git - infobot.git/blob - scripts/findparam.pl
dunno
[infobot.git] / scripts / findparam.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 my ( %param, %conf, %both );
6
7 foreach (`find -name "*.pl"`) {
8     chop;
9     my $file  = $_;
10     my $debug = 0;
11
12     open( IN, $file );
13     while (<IN>) {
14         chop;
15
16         if (/IsParam\(['"](\S+?)['"]\)/) {
17             print "File: $file: IsParam: $1\n" if $debug;
18             $param{$1}++;
19             next;
20         }
21
22         if (/IsChanConfOrWarn\(['"](\S+?)['"]\)/) {
23             print "File: $file: IsChanConfOrWarn: $1\n" if $debug;
24             $both{$1}++;
25             next;
26         }
27
28         if (/getChanConfDefault\(['"](\S+?)['"]/) {
29             print "File: $file: gCCD: $1\n" if $debug;
30             $both{$1}++;
31             next;
32         }
33
34         if (/getChanConf\(['"](\S+?)['"]/) {
35             print "File: $file: gCC: $1\n" if $debug;
36             $conf{$1}++;
37             next;
38         }
39
40         if (/IsChanConf\(['"](\S+?)['"]\)/) {
41             print "File: $file: ICC: $1\n" if $debug;
42             $conf{$1}++;
43             next;
44         }
45
46         # command hooks => IsChanConfOrWarn => both.
47         # note: this does not support multiple lines.
48         if (/\'Identifier\'[\s\t]=>[\s\t]+\'(\S+?)\'/) {
49             print "File: $file: command hook: $1\n" if $debug;
50             $both{$1}++;
51             next;
52         }
53     }
54     close IN;
55 }
56
57 print "Conf AND/OR Params:\n";
58 foreach ( sort keys %both ) {
59     print "    $_\n";
60 }
61 print "\n";
62
63 print "Params:\n";
64 foreach ( sort keys %param ) {
65     print "    $_\n";
66 }
67 print "\n";
68
69 print "Conf:\n";
70 foreach ( sort keys %conf ) {
71     print "    $_\n";
72 }
73
74 # vim:ts=4:sw=4:expandtab:tw=80