From a516eb4725488f018b59c2306ee8c23689d86dd2 Mon Sep 17 00:00:00 2001 From: Ian Young Date: Mon, 7 Nov 2016 11:20:22 +0000 Subject: [PATCH] Add a --year option to sizes.pl --- charting/sizes.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/charting/sizes.pl b/charting/sizes.pl index 0191da03..4d36b33d 100755 --- a/charting/sizes.pl +++ b/charting/sizes.pl @@ -11,13 +11,18 @@ # Parse command line arguments use Getopt::Long; my $allMonths; -GetOptions('all' => \$allMonths); +my $oneYear; +GetOptions('all' => \$allMonths, 'year' => \$oneYear); # By default, only show results for the most recent month -if (!$allMonths) { +if ($allMonths) { + # leave table intact +} elsif ($oneYear) { + # reduce months table to just the last 12 entries + @months = @months[-12..-1]; +} else { # reduce months table to one element - my $oneMonth = pop @months; - @months = ( $oneMonth ); + @months = @months[-1..-1]; } # ingest files