diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-23 08:11:53 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-23 08:11:53 +0000 |
commit | d59734caf69d43373f7a1199f028dad70c3b2350 (patch) | |
tree | e1423278d1329fdeb5580241f916608090540f67 | |
parent | 28055bbcc5c8e6371c7eaa7a0465a9e311a01764 (diff) |
move config setting into getopts
-rwxr-xr-x | ikiwiki | 49 |
1 files changed, 24 insertions, 25 deletions
@@ -11,33 +11,32 @@ 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=( #{{{ - wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$)}, - wiki_link_regexp => qr/\[\[([^\s\]]+)\]\]/, - wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/, - verbose => 0, - wikiname => "wiki", - default_pageext => ".mdwn", - cgi => 0, - svn => 1, - url => '', - cgiurl => '', - historyurl => '', - diffurl => '', - anonok => 0, - rebuild => 0, - wrapper => undef, - wrappermode => undef, - srcdir => undef, - destdir => undef, - templatedir => "/usr/share/ikiwiki/templates", - setup => undef, - adminuser => undef, -); #}}} - 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_.:\/+]+$)/, + verbose => 0, + wikiname => "wiki", + default_pageext => ".mdwn", + cgi => 0, + svn => 1, + url => '', + cgiurl => '', + historyurl => '', + diffurl => '', + anonok => 0, + rebuild => 0, + wrapper => undef, + wrappermode => undef, + srcdir => undef, + destdir => undef, + templatedir => "/usr/share/ikiwiki/templates", + setup => undef, + adminuser => undef, + ); + eval q{use Getopt::Long}; GetOptions( "setup|s=s" => \$config{setup}, |