]> git.donarmstrong.com Git - infobot.git/blobdiff - scripts/findparam.pl
- renamed setup_sql.pl to setup.pl; added findparam.pl
[infobot.git] / scripts / findparam.pl
diff --git a/scripts/findparam.pl b/scripts/findparam.pl
new file mode 100644 (file)
index 0000000..04f363a
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+my(%param, %conf, %both);
+
+foreach (`find -name "*.pl"`) {
+    chop;
+    my $file = $_;
+
+    open(IN, $file);
+    while (<IN>) {
+       chop;
+
+       if (/IsParam\(['"](\S+?)['"]\)/) {
+#          print "File: $file: IsParam: $1\n";
+           $param{$1}++;
+           next;
+       }
+
+       if (/hasParam\(['"](\S+?)['"]\)/) {
+#          print "File: $file: hasParam: $1\n";
+           $param{$1}++;
+           next;
+       }
+
+       if (/getChanConfDefault\(['"](\S+?)['"]/) {
+#          print "File: $file: gCCD: $1\n";
+           $both{$1}++;
+           next;
+       }
+
+       if (/getChanConf\(['"](\S+?)['"]\)/) {
+#          print "File: $file: gCC: $1\n";
+           $conf{$1}++;
+           next;
+       }
+
+       if (/IsChanConf\(['"](\S+?)['"]\)/) {
+#          print "File: $file: ICC: $1\n";
+           $conf{$1}++;
+           next;
+       }
+    }
+    close IN;
+}
+
+print "Conf AND/OR Params:\n";
+foreach (sort keys %both) {
+    print "    $_\n";
+}
+print "\n";
+
+print "Params:\n";
+foreach (sort keys %param) {
+    print "    $_\n";
+}
+print "\n";
+
+print "Conf:\n";
+foreach (sort keys %conf) {
+    print "    $_\n";
+}