]> git.donarmstrong.com Git - infobot.git/blob - scripts/findparam.pl
dbm2mysql.pl
[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
11     open(IN, $file);
12     while (<IN>) {
13         chop;
14
15         if (/IsParam\(['"](\S+?)['"]\)/) {
16 #           print "File: $file: IsParam: $1\n";
17             $param{$1}++;
18             next;
19         }
20
21         if (/hasParam\(['"](\S+?)['"]\)/) {
22 #           print "File: $file: hasParam: $1\n";
23             $param{$1}++;
24             next;
25         }
26
27         if (/getChanConfDefault\(['"](\S+?)['"]/) {
28 #           print "File: $file: gCCD: $1\n";
29             $both{$1}++;
30             next;
31         }
32
33         if (/getChanConf\(['"](\S+?)['"]\)/) {
34 #           print "File: $file: gCC: $1\n";
35             $conf{$1}++;
36             next;
37         }
38
39         if (/IsChanConf\(['"](\S+?)['"]\)/) {
40 #           print "File: $file: ICC: $1\n";
41             $conf{$1}++;
42             next;
43         }
44
45         # command hooks => hasParam => both.
46         # note: this does not support multiple lines.
47         if (/\'Identifier\'[\s\t]=>[\s\t]+\'(\S+?)\'/) {
48 #           print "File: $file: command hook: $1\n";
49             $both{$1}++;
50             next;
51         }
52     }
53     close IN;
54 }
55
56 print "Conf AND/OR Params:\n";
57 foreach (sort keys %both) {
58     print "    $_\n";
59 }
60 print "\n";
61
62 print "Params:\n";
63 foreach (sort keys %param) {
64     print "    $_\n";
65 }
66 print "\n";
67
68 print "Conf:\n";
69 foreach (sort keys %conf) {
70     print "    $_\n";
71 }