]> git.pond.sub.org Git - empserver/blob - info/checklist.pl
info/toc: New; generated machine-readable table of contents
[empserver] / info / checklist.pl
1 #!/usr/local/bin/perl
2 #
3 # checklist.pl
4 #
5 # By Ken Stevens <children@empire.net>
6 #
7 # FIXME This does not work at the moment
8 #
9 # HOW TO RUN IT:
10 # In empire, redirect the output of the player "list" command to a file called
11 # "player.list".  Similarly, make a file listing deity commands and call it
12 # deity.list.  Put both these files in this directory, and then run this script
13 # to check which Empire commands need to be documented.
14 #
15
16 use strict;
17 use warnings;
18
19 my ($com, @list, @obsolete, @Commands);
20
21 open(LIST, "<player.list") || die "Can't read player.list\n";
22
23 while(<LIST>) {
24   last if /^  <TYPE>/;
25 }
26
27 while(<LIST>) {
28   last if /^For further info on command syntax see/;
29   $_ = substr($_, 5);
30   ($com) = split;
31   push (@list, $com);
32 }
33 close LIST;
34
35 push(@list, "break");
36
37 open(LIST, "<deity.list") || die "Can't read deity.list\n";
38
39 while(<LIST>) {
40   last if /^  <TYPE>/;
41 }
42
43 while(<LIST>) {
44   last if /^For further info on command syntax see/;
45   $_ = substr($_, 5);
46   ($com) = split;
47   push (@list, $com);
48 }
49 close LIST;
50
51 open(OBSOLETE, "<Subjects/Obsolete.t") ||
52   die "Can't read Subjects/Obsolete.t\n";
53
54 while (<OBSOLETE>) {
55   push(@obsolete, $1) if /^.L (\S+)$/;
56 }
57
58 close OBSOLETE;
59
60 open (LS, "ls Commands|");
61
62 while (<LS>) {    
63   chop;
64   next unless /^(\S+).t/;
65   push(@Commands, $1);
66 }
67 close LS;
68
69 print "In list but not Commands:\n";
70 for my $l (@list) {
71   print "  $l\n" unless grep (/^$l$/, @Commands);
72 }
73 print "In Commands but not list:\n";
74 for my $c (@Commands) {
75   print "  $c\n" unless grep(/^$c$/, @list) || grep(/^$c$/, @obsolete);
76 }