httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbo...@apache.org
Subject svn commit: r1625072 - /httpd/docs-build/trunk/irc_factoids.pl
Date Mon, 15 Sep 2014 15:33:20 GMT
Author: rbowen
Date: Mon Sep 15 15:33:19 2014
New Revision: 1625072

URL: http://svn.apache.org/r1625072
Log:
Handle it correctly when a module has only one directive.

Modified:
    httpd/docs-build/trunk/irc_factoids.pl

Modified: httpd/docs-build/trunk/irc_factoids.pl
URL: http://svn.apache.org/viewvc/httpd/docs-build/trunk/irc_factoids.pl?rev=1625072&r1=1625071&r2=1625072&view=diff
==============================================================================
--- httpd/docs-build/trunk/irc_factoids.pl (original)
+++ httpd/docs-build/trunk/irc_factoids.pl Mon Sep 15 15:33:19 2014
@@ -21,12 +21,22 @@ my $xml = $xs->XMLin( $file );
 print "forget $opt_m\n" if $opt_f;
 print "$opt_m is " . 'http://httpd.apache.org/docs/' . ( $opt_v ? $opt_v : 'current' ) .
'/mod/' . $opt_m .  '.html' . "\n\n";
 
-my @directives;
-foreach my $directive ( sort( keys %{ $xml->{directivesynopsis} } ) ) {
+my $directives = $xml->{directivesynopsis};
 
-    my $d = $xml->{directivesynopsis}->{$directive};
+my %directives;
+# Was there more than one?
+if ( $directives->{name} ) { # There was only one
+   %directives = ( $directives->{name} => $directives ); 
+} else { # More than one
+    %directives = %{ $xml->{directivesynopsis} };
+}
+
+foreach my $directive ( sort( keys %directives ) ) {
+
+    my $d = $directives{$directive};
 
-    my $desc = $d->{description}; $desc =~ s/[\r\n]/ /gs;
+    my $desc = $d->{description}; 
+    $desc =~ s/[\r\n]/ /gs;
     my $name = $directive . ( $opt_v ? " $opt_v" : '' );
 
     print "forget $name\n" if $opt_f;



Mime
View raw message