X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=groupstats.pl;h=ccd7f869682483e27c7540acf8c548194d62c681;hp=19c54e1339b93c5823d5743c6041b7995ec8fcd0;hb=71f0178b2aabf91b4f6afe3911f615d056fbf4a0;hpb=628a183c15adf643575f00b92b9ad6d98b584310 diff --git a/groupstats.pl b/groupstats.pl index 19c54e1..ccd7f86 100755 --- a/groupstats.pl +++ b/groupstats.pl @@ -99,6 +99,8 @@ if ($Options{'a'}) { } else { ($StartMonth,$EndMonth) = &GetTimePeriod($Options{'m'},$Options{'p'}); }; +# if -p or -a are set: drop -m +undef $Options{'m'} if ($Options{'p'} or $Options{'a'}); # if time period is more than one month: force output type to '-o pretty' or '-o dumpgroup' if ($Options{'o'} eq 'dump' and ($Options{'p'} or $Options{'a'})) { if (defined($Options{'n'}) and $Options{'n'} !~ /:|\*/) { @@ -207,10 +209,10 @@ $DBQuery->execute($StartMonth,$EndMonth,@GroupList,@Params) undef($Options{'c'}) if $Options{'f'}; # print caption (-c) with time period if -m or -p is set if ($Options{'c'}) { - if ($Options{'p'}) { - printf ("----- Report from %s to %s\n",$StartMonth,$EndMonth); - } elsif ($Options{'m'}) { + if ($Options{'m'}) { printf ("----- Report for %s\n",$StartMonth); + } else { + printf ("----- Report from %s to %s %s\n",$StartMonth,$EndMonth,$Options{'a'} ? '(all months)' : ''); }; }; # print caption (-c) with newsgroup list if -n is set