Add option '-c': define another .rcfile.
authorThomas Hochstein <thh@inter.net>
Thu, 8 Apr 2010 05:41:43 +0000 (07:41 +0200)
committerThomas Hochstein <thh@inter.net>
Sat, 10 Apr 2010 20:07:08 +0000 (22:07 +0200)
Signed-off-by: Thomas Hochstein <thh@inter.net>
yapfaq.pl

index 23f7e5a..c9a8098 100644 (file)
--- a/yapfaq.pl
+++ b/yapfaq.pl
@@ -62,7 +62,7 @@ my ($TDY, $TDM, $TDD) = Today(); #TD: Today's date
 
 # read commandline options
 my %Options;
-getopts('Vhvpdt:f:s:', \%Options);
+getopts('Vhvpdt:f:c:s:', \%Options);
 # -V: print version / copyright information
 if ($Options{'V'}) {
   print "$0 v $Version\nCopyright (c) 2003 Marc Brockschmidt <marc\@marcbrockschmidt.de>\nCopyright (c) 2010 Thomas Hochstein <thh\@inter.net>\n";
@@ -78,7 +78,12 @@ if ($Options{'h'}) {
 my ($Faq) = $Options{'f'} if ($Options{'f'});
 
 # read runtime configuration (configuration variables)
-readrc (\$RCFile,\%Config) if -f $RCFile;
+$RCFile = $Options{'c'} if ($Options{'c'});
+if (-f $RCFile) {
+  readrc (\$RCFile,\%Config);
+} else {
+  warn "$0: W: .rc file $RCFile does not exist!\n";
+}
 
 # read configuration (configured FAQs)
 my @Config;
This page took 0.012115 seconds and 4 git commands to generate.