groupstats.pl: Improve automatic adaption of output type.
[usenet/newsstats.git] / groupstats.pl
index f758b8c..ef59cb7 100755 (executable)
@@ -73,10 +73,15 @@ if ($Options{'l'}) {
 
 ### get time period
 my ($StartMonth,$EndMonth) = &GetTimePeriod($Options{'m'},$Options{'p'});
 
 ### get time period
 my ($StartMonth,$EndMonth) = &GetTimePeriod($Options{'m'},$Options{'p'});
-# reset to one month for 'dump' output type
+# if time period is more than one month: set output type to '-o pretty' or '-o dumpgroup'
 if ($Options{'o'} eq 'dump' and $Options{'p'}) {
 if ($Options{'o'} eq 'dump' and $Options{'p'}) {
-  warn ("$MySelf: W: You cannot combine time periods (-p) with '-o dump', changing output type to '-o pretty'.\n");
-  $Options{'o'} = 'pretty';
+  if (defined($Options{'n'}) and $Options{'n'} !~ /:|\*/) {
+   warn ("$MySelf: W: You cannot combine time periods (-p) with '-o dump', changing output type to '-o dumpgroup'.\n");
+   $Options{'o'} = 'dumpgroup';
+  } else {
+   warn ("$MySelf: W: You cannot combine time periods (-p) with '-o dump', changing output type to '-o pretty'.\n");
+   $Options{'o'} = 'pretty';
+  }
 };
 
 ### init database
 };
 
 ### init database
This page took 0.010633 seconds and 4 git commands to generate.