@@ -228,6 +228,9 @@ sub sort_warnings {
228
228
' off' => ' Disabled' ,
229
229
' err' => ' Enabled and promoted to error' );
230
230
231
+ my @indexinfo = ();
232
+ my @outtxt = ();
233
+
231
234
foreach my $pfx (sort { $a cmp $b } keys (%prefixes )) {
232
235
my $warn = $aliases {$pfx };
233
236
my @doc ;
@@ -236,25 +239,23 @@ sub sort_warnings {
236
239
my @plist = sort { $a cmp $b } @{$prefixes {$pfx }};
237
240
next if ( $#plist < 1 );
238
241
239
- @doc = (" is a group alias for all warning classes prefixed by " .
240
- " \\ c{" .$pfx ." -}; currently\n " );
241
- for (my $i = 0; $i <= $#plist ; $i ++) {
242
- if ($i > 0) {
243
- if ($i < $#plist ) {
244
- push (@doc , " , " );
245
- } else {
246
- push (@doc , ($i == 1) ? " and " : " , and " );
247
- }
248
- }
249
- push (@doc , ' \c{' .$plist [$i ].' }' );
250
- }
251
- push (@doc , " .\n " );
242
+ @doc = (" all \\ c{$pfx -} warnings\n\n " ,
243
+ " \\ > \\ c{$pfx } is a group alias for all warning classes\n " ,
244
+ " prefixed by \\ c{$pfx -}; currently\n " );
245
+ # Just commas is bad grammar to be sure, but it is more
246
+ # legible than the alternative.
247
+ push (@doc , join (scalar (@plist ) < 3 ? ' and ' : ' ,' , @plist )." .\n " );
252
248
} elsif ($pfx ne $warn -> {name }) {
253
- @doc = (" is a backwards compatibility alias for \\ c{" ,
254
- $warn -> {name }, " }.\n " );
249
+ my $awarn = $aliases {$warn -> {name }};
250
+ @doc = ($awarn -> {help }." \n\n " ,
251
+ " \\ > \\ c{$pfx } is a backwards compatibility alias for \\ c{" .
252
+ $warn -> {name }." }.\n " );
255
253
} else {
256
254
my $docdef = $whatdef {$warn -> {def }};
257
255
256
+ @doc = ($warn -> {help }." \n\n " ,
257
+ " \\ > \\ c{" .$warn -> {name }." } " );
258
+
258
259
my $newpara = 0;
259
260
foreach my $l (@{$warn -> {doc }}) {
260
261
if ($l =~ / ^\s *$ / ) {
@@ -272,8 +273,11 @@ sub sort_warnings {
272
273
}
273
274
}
274
275
275
- print $out " \\ b \\ i\\ c{" , $pfx , " } " , @doc , " \n " ;
276
+ push (@indexinfo , " \\ IR{w-$pfx } warning class, \\ c{$pfx }\n " );
277
+ push (@outtxt , " \\ b \\ I{w-$pfx } \\ c{$pfx }: " , @doc , " \n " );
276
278
}
279
+
280
+ print $out " \n " , @indexinfo , " \n " , @outtxt ;
277
281
}
278
282
279
283
close ($out );
0 commit comments