$ConfOverride{'DBTableGrps'} = $Options{'g'} if $Options{'g'};\r
&OverrideConfig(\%Conf,\%ConfOverride);\r
\r
-### default output type to 'dump'\r
+### check for incompatible command line options\r
+# you can't mix '-t', '-b' and '-l'\r
+# -b/-l take preference over -t, and -b takes preference over -l\r
+if ($Options{'b'} or $Options{'l'}) {\r
+ if ($Options{'t'}) {\r
+ # drop -t\r
+ warn ("$MySelf: W: You cannot combine thresholds (-t) and top lists (-b) or levels (-l). Threshold '-t $Options{'t'}' was ignored.\n");\r
+ undef($Options{'t'});\r
+ };\r
+ if ($Options{'b'} and $Options{'l'}) {\r
+ # drop -l\r
+ warn ("$MySelf: W: You cannot combine top lists (-b) and levels (-l). Level '-l $Options{'l'}' was ignored.\n");\r
+ undef($Options{'l'});\r
+ };\r
+ # -q/-d don't work with -b or -l\r
+ warn ("$MySelf: W: Sorting by number of postings (-q) ignored due to top list mode (-b) / levels (-l).\n") if $Options{'q'};\r
+ warn ("$MySelf: W: Reverse sorting (-d) ignored due to top list mode (-b) / levels (-l).\n") if $Options{'d'};\r
+};\r
+\r
+### check output type\r
+# default output type to 'dump'\r
$Options{'o'} = 'dump' if !$Options{'o'};\r
# fail if more than one newsgroup is combined with 'dumpgroup' type\r
die ("$MySelf: E: You cannot combine newsgroup lists (-n) with more than one group with '-o dumpgroup'!\n") if ($Options{'o'} eq 'dumpgroup' and defined($Options{'n'}) and $Options{'n'} =~ /:|\*/);\r
$Options{'o'} = 'dump';\r
warn ("$MySelf: W: You must submit exactly one newsgroup ('-n news.group') for '-o dumpgroup'. Output type was set to 'dump'.\n");\r
};\r
-# you can't mix '-t' and '-b'\r
-if ($Options{'b'}) {\r
- if ($Options{'t'}) {\r
- warn ("$MySelf: W: You cannot combine thresholds (-t) and top lists (-b). Threshold '-t $Options{'t'}' was ignored.\n");\r
- undef($Options{'t'});\r
- };\r
- warn ("$MySelf: W: Sorting by number of postings (-q) ignored due to top list mode (-b).\n") if $Options{'q'};\r
- warn ("$MySelf: W: Reverse sorting (-d) ignored due to top list mode (-b).\n") if $Options{'d'};\r
+# set output type to 'pretty' for -l\r
+if ($Options{'l'}) {\r
+ $Options{'o'} = 'pretty';\r
+ warn ("$MySelf: W: Output type forced to '-o pretty' due to usage of '-l'.\n");\r
};\r
\r
### get query type, default to 'postings'\r