From f170c26eb2c93bb29a1b6c725111f1cbbebe33bd Mon Sep 17 00:00:00 2001 From: Ian Young Date: Wed, 2 Jun 2010 10:13:13 +0000 Subject: [PATCH] By default, show results for most recent month only. Add an --all option to show complete history. --- charting/saml2.pl | 12 ++++++++++++ charting/sizes.pl | 12 ++++++++++++ charting/trust.pl | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/charting/saml2.pl b/charting/saml2.pl index 5ab9883c..c5ba8b28 100755 --- a/charting/saml2.pl +++ b/charting/saml2.pl @@ -9,6 +9,18 @@ use Xalan; use Months; +# Parse command line arguments +use Getopt::Long; +my $allMonths; +GetOptions('all' => \$allMonths); + +# By default, only show results for the most recent month +if (!$allMonths) { + # reduce months table to one element + my $oneMonth = pop @months; + @months = ( $oneMonth ); +} + # ingest files foreach $month (@months) { my $fn = "cache/$month.xml"; diff --git a/charting/sizes.pl b/charting/sizes.pl index fd5ed7ac..a7b19fd5 100755 --- a/charting/sizes.pl +++ b/charting/sizes.pl @@ -6,6 +6,18 @@ use File::stat; use Months; +# Parse command line arguments +use Getopt::Long; +my $allMonths; +GetOptions('all' => \$allMonths); + +# By default, only show results for the most recent month +if (!$allMonths) { + # reduce months table to one element + my $oneMonth = pop @months; + @months = ( $oneMonth ); +} + # ingest files foreach $month (@months) { my $fn = "cache/$month.xml"; diff --git a/charting/trust.pl b/charting/trust.pl index 63e5c260..7bf89f04 100755 --- a/charting/trust.pl +++ b/charting/trust.pl @@ -9,6 +9,18 @@ use Xalan; use Months; +# Parse command line arguments +use Getopt::Long; +my $allMonths; +GetOptions('all' => \$allMonths); + +# By default, only show results for the most recent month +if (!$allMonths) { + # reduce months table to one element + my $oneMonth = pop @months; + @months = ( $oneMonth ); +} + # ingest files foreach $month (@months) { my $fn = "cache/$month.xml";