You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2012/02/23 21:02:09 UTC

svn commit: r1292932 - /httpd/docs-build/trunk/irc_factoids.pl

Author: rbowen
Date: Thu Feb 23 20:02:09 2012
New Revision: 1292932

URL: http://svn.apache.org/viewvc?rev=1292932&view=rev
Log:
Outputs statements that can be pasted directly into the a message to the
bot. Makes the bot's name configurable.

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=1292932&r1=1292931&r2=1292932&view=diff
==============================================================================
--- httpd/docs-build/trunk/irc_factoids.pl (original)
+++ httpd/docs-build/trunk/irc_factoids.pl Thu Feb 23 20:02:09 2012
@@ -4,33 +4,56 @@ use Getopt::Std;
 use Data::Dumper;
 use strict;
 
-our ( $opt_m, $opt_v );
+our ( $opt_m, $opt_v, $opt_b );
 our $VERSION = '0.01';
 
-getopts("m:v:");
+getopts("m:v:b:");
 HELP_MESSAGE('The -m option is required.') unless $opt_m;
 
 $opt_m =~ s/\.xml$//;
 HELP_MESSAGE('File '. $opt_m . '.xml not found.') unless -f $opt_m . '.xml';
 
 my $file = $opt_m . '.xml';
-my $v = $opt_v ? $opt_v : 'current';
+
+my $bot = $opt_b ? $opt_b : 'fajita';
+my $addr = $bot . ': ';
 
 my $xs = XML::Simple->new();
 my $xml = $xs->XMLin( $file );
 
+print $addr . "forget $opt_m\n";
+print $addr . "$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} } ) ) {
-    print $directive . "\n";
-    print 'http://httpd.apache.org/docs/' . $v . '/mod/' . $opt_m .  '.html#' . lc( $directive ) .  "\n";
 
     my $d = $xml->{directivesynopsis}->{$directive};
 
     my $desc = $d->{description}; $desc =~ s/[\r\n]/ /gs;
+    my $name = $directive . ( $opt_v ? " $opt_v" : '' );
+
+    print $addr . "forget $name\n";
+    print $addr . "$name is ";
+    print 'http://httpd.apache.org/docs/' . ( $opt_v ? $opt_v : 'current' ) . '/mod/' . $opt_m .  '.html#' . lc( $directive ) .  " - ";
     print $desc . "\n";
-    print 'Default: ' . $d->{default} . "\n";
-    print 'Override: ' . $d->{override} . "\n";
-    print 'Context: ' . ( join ', ', @{ $d->{contextlist}->{context} } ) . "\n";
+
+    print $addr . "forget $name default\n";
+    if ( $d->{default} ) {
+        print $addr . "$name default is " . $d->{default} . "\n";
+    } else {
+        print $addr . "$name default is <reply>$name has not default value";
+    }
+
+    print $addr . "forget $name override\n";
+    if ( $d->{override} ) {
+        print $addr . "$name override is <reply>$name may be used in an .htaccess file if AllowOverride is set to ".$d->{override}."\n";
+    } else {
+        print $addr . "$name override is <reply>$name may not be used in a .htaccess file\n";
+    }
+
+    print $addr . "forget $name context\n";
+    print $addr . "$name context is <reply>$name may be used in the following contexts: ";
+    print ( join ', ', @{ $d->{contextlist}->{context} } ) . "\n";
     print "\n\n";
 
 }