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:17:17 UTC
svn commit: r1292936 - /httpd/docs-build/trunk/irc_factoids.pl
Author: rbowen
Date: Thu Feb 23 20:17:16 2012
New Revision: 1292936
URL: http://svn.apache.org/viewvc?rev=1292936&view=rev
Log:
Makes the 'forget ...' statements optional, triggered with the -f flag.
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=1292936&r1=1292935&r2=1292936&view=diff
==============================================================================
--- httpd/docs-build/trunk/irc_factoids.pl (original)
+++ httpd/docs-build/trunk/irc_factoids.pl Thu Feb 23 20:17:16 2012
@@ -4,10 +4,10 @@ use Getopt::Std;
use Data::Dumper;
use strict;
-our ( $opt_m, $opt_v );
+our ( $opt_m, $opt_v, $opt_f );
our $VERSION = '0.01';
-getopts("m:v:");
+getopts("fm:v:");
HELP_MESSAGE('The -m option is required.') unless $opt_m;
$opt_m =~ s/\.xml$//;
@@ -18,7 +18,7 @@ my $file = $opt_m . '.xml';
my $xs = XML::Simple->new();
my $xml = $xs->XMLin( $file );
-print "forget $opt_m\n";
+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;
@@ -29,26 +29,26 @@ foreach my $directive ( sort( keys %{ $x
my $desc = $d->{description}; $desc =~ s/[\r\n]/ /gs;
my $name = $directive . ( $opt_v ? " $opt_v" : '' );
- print "forget $name\n";
+ print "forget $name\n" if $opt_f;
print "$name is ";
print 'http://httpd.apache.org/docs/' . ( $opt_v ? $opt_v : 'current' ) . '/mod/' . $opt_m . '.html#' . lc( $directive ) . " - ";
print $desc . "\n";
- print "forget $name default\n";
+ print "forget $name default\n" if $opt_f;
if ( $d->{default} ) {
print "$name default is " . $d->{default} . "\n";
} else {
print "$name default is <reply>$name has no default value\n";
}
- print "forget $name override\n";
+ print "forget $name override\n" if $opt_f;
if ( $d->{override} ) {
print "$name override is <reply>$name may be used in an .htaccess file if AllowOverride is set to ".$d->{override}."\n";
} else {
print "$name override is <reply>$name may not be used in a .htaccess file\n";
}
- print "forget $name context\n";
+ print "forget $name context\n" if $opt_f;
print "$name context is <reply>$name may be used in the following contexts: ";
my $contexts = ref( $d->{contextlist}->{context} ) ? $d->{contextlist}->{context} : [ $d->{contextlist}->{context} ];
print ( join ', ', @{ $contexts } ) . "\n";
@@ -73,6 +73,8 @@ be fed to the IRC bot.
-v version - Generate URLs for this version. Defaults to "current"
+-f Adds the 'forget' statements to make the bot forget the existing version of the factoid.
+
~;
exit();