#! /usr/bin/perl -W
#
-# yapfaq Version 0.6 by Thomas Hochstein
+# yapfaq Version 0.7 by Thomas Hochstein
# (Original author: Marc Brockschmidt)
#
# This script posts any project described in its config-file. Most people
# It can be redistributed and/or modified under the same terms under
# which Perl itself is published.
-my $Version = "0.6.2";
+my $Version = "0.8-prelease";
+# Please do not change this setting!
+# You may override the default .rc file (.yapfaqrc) by using "-c .rc file"
my $RCFile = '.yapfaqrc';
+# Valid configuration variables for use in a .rc file
my @ValidConfVars = ('NNTPServer','NNTPUser','NNTPPass','Sender','ConfigFile',
'UsePGP','pgp','PGPVersion','PGPSigner','PGPPass',
'PathtoPGPPass','pgpbegin','pgpend','pgptmpf','pgpheader');
-################################### Defaults ##################################
-my %Config = (NNTPServer => "localhost",
+################################### Defaults ###################################
+# Please do not change anything in here!
+# Use a runtime configuration file (.yapfaqrc by default) to override defaults.
+my %Config = (NNTPServer => "",
NNTPUser => "",
NNTPPass => "",
Sender => "",
'content-transfer-encoding', 'summary', 'keywords', 'cancel-lock',
'cancel-key', 'also-control', 'x-pgp', 'user-agent');
-############################# End of Configuration #############################
+################################# Main program #################################
use strict;
use Net::NNTP;
my ($File, $Config, $Faq) = @_;
my ($LastEntry, $Error, $i) = ('','',0);
- print "Reading configuration.\n" if($Options{'v'});
+ print "Reading configuration from $$File.\n" if($Options{'v'});
open FH, "<$$File" or die "$0: E: Can't open $$File: $!";
while (<FH>) {
=head1 SYNOPSIS
-B<yapfaq> [B<-hvpd>] [B<-t> I<newsgroups> | CONSOLE] [B<-f> I<project name>] [B<-s> I<program>] [B<-c> I<.rc file>]
+B<yapfaq> [B<-Vhvpd>] [B<-t> I<newsgroups> | CONSOLE] [B<-f> I<project name>] [B<-s> I<program>] [B<-c> I<.rc file>]
=head1 REQUIREMENTS
yapfaq -t de.test -f myfaq
+Post all FAQs (that are due for posting) using inews from INN:
+
+ yapfaq -s inews
+
+Do a dry run using a runtime configuration from .alternaterc, showing
+which FAQs would be posted:
+
+ yapfaq -dvc .alternaterc
+
=head1 ENVIRONMENT
-There are no special environment variables used by B<yapfaq>.
+=over 4
+
+=item NNTPSERVER
+
+The default NNTP server to post to, used by the Net::NNTP module. You
+can also specify the server using the runtime configuration file (by
+default F<.yapfaqrc>).
+
+=back
=head1 FILES