diff --git a/charting/scopes.pl b/charting/scopes.pl index 87de05aa..2e38809d 100755 --- a/charting/scopes.pl +++ b/charting/scopes.pl @@ -12,13 +12,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 @@ -31,7 +36,9 @@ my $scope = $_; $scopes{$scope} = 1; } - push @count, scalar(keys(%scopes)); + my $prefix = scalar(@months) == 1 ? '' : "$month: "; + my $c = scalar(keys(%scopes)); + push @count, "$prefix$c"; close TXT; } @@ -40,4 +47,4 @@ print "$n\n"; } -1; \ No newline at end of file +1;