X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=groupstats.pl;h=a09c632890e36296796b01a663eb6ed23bd9028f;hp=1c143d2e33654a3ffaf9b74afe0d6216b293c511;hb=d8695b1c044f9a99f06a7943f88fe2191e6cc52a;hpb=2832c235b2497a02713b12197ed97fbde3a91e15 diff --git a/groupstats.pl b/groupstats.pl index 1c143d2..a09c632 100755 --- a/groupstats.pl +++ b/groupstats.pl @@ -75,8 +75,8 @@ if ($Options{'l'}) { my ($StartMonth,$EndMonth) = &GetTimePeriod($Options{'m'},$Options{'p'}); # reset to one month for 'dump' output type if ($Options{'o'} eq 'dump' and $Options{'p'}) { - $StartMonth = $EndMonth; - warn ("$MySelf: W: You cannot combine time periods (-p) with '-o dump'. Month was set to $StartMonth.\n"); + warn ("$MySelf: W: You cannot combine time periods (-p) with '-o dump', changing output type to '-o pretty'.\n"); + $Options{'o'} = 'pretty'; }; ### init database @@ -136,6 +136,8 @@ if (!defined($Options{'b'}) and !defined($Options{'l'})) { } else { $OrderClause = 'postings DESC'; }; + # set -b to 10 if < 1 (Top 10) + $Options{'b'} = 10 if $Options{'b'} !~ /^\d*$/ or $Options{'b'} < 1; # push LIMIT to GroupList to match number of binding vars for DBQuery->execute push @GroupList,$Options{'b'}; # prepare query: get sum of postings per group from groups table for given months and newsgroups with LIMIT