Index: trunk/ippMonitor/generate
===================================================================
--- trunk/ippMonitor/generate	(revision 8980)
+++ trunk/ippMonitor/generate	(revision 8984)
@@ -2,4 +2,5 @@
 
 $VERBOSE = 0;
+
 if ($ARGV[0] eq "-v") { $VERBOSE = 1; shift @ARGV; }
 if (@ARGV != 3) { die "generate (schema) (template) (output)\n"; }
@@ -18,7 +19,10 @@
     close (FILE);
 
+    &init_key ("MENU");
+    &init_key ("STYLE");
     &init_key ("TABLE");
     &init_key ("TITLE");
     &init_key ("FILE");
+
     &init_key ("FIELDS");
 
@@ -54,4 +58,12 @@
 	}
     }
+
+    # check on keys
+    &check_key ("MENU", "ipp.menu.dat");
+    &check_key ("STYLE", "ipp.css");
+    &check_key ("TABLE", "");
+    &check_key ("TITLE", "");
+    &check_key ("FILE", "");
+
     # define query string, add to keypairs
     &define_query_fields;
@@ -192,7 +204,24 @@
 	    if ($value[$i] ne "") { die "key is multiply defined\n"; }
 	    $value[$i] = $value;
+	    if ($VERBOSE) { print STDERR "setting $key = $value\n"; }
 	    return;
 	}
     }
+}
+
+sub check_key {
+    my ($i);
+    my ($key)     = $_[0];
+    my ($default) = $_[1];
+
+    for ($i = 0; $i < @key; $i++) {
+	if ($key eq $key[$i]) {
+	    if ($VERBOSE) { print "found $key: $key[$i]  -- $value[$i] (def: $default)\n"; }
+	    if (($default eq "") && ($value[$i] eq "")) { die "missing value for required key $key[$i]\n"; }
+	    if ($value[$i] eq "") { $value[$i] = $default; }
+	    return;
+	}
+    }
+    die "unknown key $key\n";
 }
 
@@ -200,5 +229,5 @@
     my ($i);
     for ($i = 0; $i < @key; $i++) {
-	# if ($VERBOSE) { print "$key[$i]  -- $value[$i]\n"; }
+	if ($VERBOSE) { print "$key[$i]  -- $value[$i]\n"; }
 	if ($line =~ m|\$$key[$i]|) {
 	    if ($value[$i] eq "") { die "missing value for required key $key[$i]\n"; }
