move config setting into getopts
parent
28055bbcc5
commit
d59734caf6
9
ikiwiki
9
ikiwiki
|
@ -11,8 +11,9 @@ use lib '.'; # For use without installation, removed by Makefile.
|
|||
|
||||
use vars qw{%config %links %oldlinks %oldpagemtime %renderedfiles %pagesources};
|
||||
|
||||
# Holds global config settings, also used by some modules.
|
||||
our %config=( #{{{
|
||||
sub getconfig () { #{{{
|
||||
if (! exists $ENV{WRAPPED_OPTIONS}) {
|
||||
%config=(
|
||||
wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$)},
|
||||
wiki_link_regexp => qr/\[\[([^\s\]]+)\]\]/,
|
||||
wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/,
|
||||
|
@ -34,10 +35,8 @@ our %config=( #{{{
|
|||
templatedir => "/usr/share/ikiwiki/templates",
|
||||
setup => undef,
|
||||
adminuser => undef,
|
||||
); #}}}
|
||||
);
|
||||
|
||||
sub getconfig () { #{{{
|
||||
if (! exists $ENV{WRAPPED_OPTIONS}) {
|
||||
eval q{use Getopt::Long};
|
||||
GetOptions(
|
||||
"setup|s=s" => \$config{setup},
|
||||
|
|
Loading…
Reference in New Issue