Index: trunk/tools/czarmetrics.pl
===================================================================
--- trunk/tools/czarmetrics.pl	(revision 29803)
+++ trunk/tools/czarmetrics.pl	(revision 29868)
@@ -9,4 +9,6 @@
 
 use czartool::DayMetrics;
+use czartool::MultiDayMetrics;
+use czartool::MetricsIndex;
 use czartool::CzarDb;
 use czartool::Gpc1Db;
@@ -16,4 +18,6 @@
 my $begin = undef;
 my $end = undef;
+my $cumulative = undef;
+my $index = undef;
 my $verbose = undef;
 my $save_temps = undef;
@@ -23,5 +27,7 @@
         "begin|b=s" => \$begin,
         "end|e=s" => \$end,
-        "day|y=s" => \$day,
+        "day|d=s" => \$day,
+        "index|i" => \$index,
+        "cumulative|c" => \$cumulative,
         "verbose|v" => \$verbose,
         );
@@ -35,11 +41,17 @@
 }
 if (!$day) {
-    print "* OPTIONAL: choose a single day             -y <date>               (default=today)\n";
+    print "* OPTIONAL: choose a single day                -d <date>               (default=today)\n";
 }
-if (!$begin) {
-    print "* OPTIONAL: choose a begin date             -b <date>               (default=today)\n";}
-if (!$end) 
-{
-    print "* OPTIONAL: choose an end date              -e <date>               (default=today)\n";
+if (!$begin) { 
+    print "* OPTIONAL: choose a begin date                -b <date>               (default=today)\n";
+}
+if (!$end) {
+    print "* OPTIONAL: choose an end date                 -e <date>               (default=today)\n";
+}
+if (!$cumulative) {
+    print "* OPTIONAL: cumulative metrics for date range  -c                      (default=off)\n";
+}
+if (!$index) {
+    print "* OPTIONAL: create index file for all metrics  -i                      (default=off)\n";
 }
 
@@ -52,4 +64,10 @@
 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
 
+if ($index) {
+
+    my $metricsIndex = new czartool::MetricsIndex($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0);
+    $metricsIndex->writeHTML();
+    exit;
+}
 
 if (!$day && !$begin && !$end) {
@@ -61,10 +79,20 @@
 
 my $thisDay = $begin;
-while (1) {
 
-    my $dayMetrics = new czartool::DayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $thisDay);
-    $dayMetrics->writeHTML();
+if ($cumulative) {
 
-    $thisDay = $czarDb->addInterval($thisDay, "1 DAY");
-    if ($czarDb->isBefore($end, $thisDay)) {last;}
+        my $multiDayMetrics = new czartool::MultiDayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $begin, $end);
+        $multiDayMetrics->writeHTML();
 }
+else {
+
+    while (1) {
+
+        my $dayMetrics = new czartool::DayMetrics($gpc1Db, $czarDb, "/data/ipp004.0/ipp/ippMetrics/", 1, 0, $thisDay);
+        $dayMetrics->writeHTML();
+
+        $thisDay = $czarDb->addInterval($thisDay, "1 DAY");
+        if ($czarDb->isBefore($end, $thisDay)) {last;}
+    }
+}
+
