From: Thomas Hochstein Date: Thu, 8 Apr 2010 05:41:43 +0000 (+0200) Subject: Add option '-c': define another .rcfile. X-Git-Tag: v0.7~5 X-Git-Url: https://code.th-h.de/?p=usenet%2Fyapfaq.git;a=commitdiff_plain;h=86c0a10044727dae98e0ccbd9aee475e8154c15f Add option '-c': define another .rcfile. Signed-off-by: Thomas Hochstein --- diff --git a/yapfaq.pl b/yapfaq.pl index 23f7e5a..c9a8098 100644 --- 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 \nCopyright (c) 2010 Thomas Hochstein \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;