[LON-CAPA-cvs] cvs: doc /help usage.pl

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 14 Sep 2004 19:57:15 -0000


albertel		Tue Sep 14 15:57:15 2004 EDT

  Modified files:              
    /doc/help	usage.pl 
  Log:
  - addin which manual it is in
  
  
Index: doc/help/usage.pl
diff -u doc/help/usage.pl:1.1 doc/help/usage.pl:1.2
--- doc/help/usage.pl:1.1	Tue Sep 14 15:47:02 2004
+++ doc/help/usage.pl	Tue Sep 14 15:57:15 2004
@@ -30,19 +30,31 @@
     my ($all,$usage)=@_;
     my %all;
     my %no_exist;
-    foreach my $file (@{ $all }) {$all{$file}=0;}
+    foreach my $file (@{ $all }) {$all{$file}=[];}
+    my @order=('author','course','developer');
     foreach my $list (@{ $usage }) {
 	foreach my $file (@{ $list }) {
-	    if (exists($all{$file})) { $all{$file}++; } else { $no_exist{$file}++; }
+	    if (exists($all{$file})) { 
+		push(@{$all{$file}},$order[0]);
+	    } else {
+		push(@{$no_exist{$file}},$order[0]);
+	    }
 	}
+	shift(@order);
     }
     print("Usage count for existing Files:\n");
     foreach my $file (sort {uc($a) cmp uc($b)} (keys(%all))) {
-	printf("%-50s: %s\n",$file,$all{$file});
+	if (scalar(@{ $all{$file} }) ne 0) {
+	    printf("%-50s: %s in %s\n",$file,scalar(@{$all{$file}}),
+		   join(',',@{$all{$file}}));
+	} else {
+	    printf("%-50s: %s\n",$file,scalar(@{$all{$file}}));
+	}
     }
     print("Usage count for nonexistint Files:\n");
     foreach my $file (sort {uc($a) cmp uc($b)} (keys(%no_exist))) {
-	printf("%-50s: %s\n",$file,$no_exist{$file});
+	printf("%-50s: %s in %s\n",$file,scalar(@{$no_exist{$file}}),
+	       join(',',@{$no_exist{$file}}));
     }
 }