X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/5bea644fdd9216ace2015d1e9ca85cde21689180..950850f63911d7f54f23e0699f820369b32a3532:/ikiwiki.in diff --git a/ikiwiki.in b/ikiwiki.in index 0f82f77ac..d8e848f87 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -28,7 +28,7 @@ sub getconfig () { #{{{ "refresh!" => \$config{refresh}, "post-commit" => \$config{post_commit}, "render=s" => \$config{render}, - "wrappers!" => \$config{wrappers}, + "wrappers!" => \$config{genwrappers}, "usedirs!" => \$config{usedirs}, "prefix-directives!" => \$config{prefix_directives}, "getctime" => \$config{getctime}, @@ -46,7 +46,6 @@ sub getconfig () { #{{{ "adminemail=s" => \$config{adminemail}, "timeformat=s" => \$config{timeformat}, "sslcookie!" => \$config{sslcookie}, - "httpauth!" => \$config{httpauth}, "userdir=s" => \$config{userdir}, "htmlext=s" => \$config{htmlext}, "libdir=s" => \$config{libdir}, @@ -69,7 +68,7 @@ sub getconfig () { #{{{ $config{wrappermode}=possibly_foolish_untaint($_[1]) }, "plugin=s@" => sub { - push @{$config{plugin}}, $_[1]; + push @{$config{add_plugins}}, $_[1]; }, "disable-plugin=s@" => sub { push @{$config{disable_plugins}}, $_[1]; @@ -89,10 +88,14 @@ sub getconfig () { #{{{ if (! $config{setup} && ! $config{render}) { loadplugins(); - usage() unless @ARGV == 2; - $config{srcdir} = possibly_foolish_untaint(shift @ARGV); - $config{destdir} = possibly_foolish_untaint(shift @ARGV); - checkconfig(); + if (@ARGV == 2) { + $config{srcdir} = possibly_foolish_untaint(shift @ARGV); + $config{destdir} = possibly_foolish_untaint(shift @ARGV); + checkconfig(); + } + else { + usage() unless $config{dumpsetup}; + } } } else { @@ -113,13 +116,19 @@ sub main () { #{{{ if ($config{setup}) { require IkiWiki::Setup; IkiWiki::Setup::load($config{setup}); - if (! $config{render} && ! $config{dumpsetup} && - (! $config{refresh} || $config{wrappers})) { + + loadplugins(); + checkconfig(); + + if (@{$config{wrappers}} && + ! $config{render} && ! $config{dumpsetup} && + (! $config{refresh} || $config{genwrappers})) { debug(gettext("generating wrappers..")); require IkiWiki::Wrapper; my %origconfig=(%config); my @wrappers=@{$config{wrappers}}; delete $config{wrappers}; + delete $config{genwrappers}; foreach my $wrapper (@wrappers) { %config=(%origconfig, rebuild => 0, @@ -142,15 +151,11 @@ sub main () { #{{{ # ignore syslog setting from setup file # while doing initial setup - $config{syslog}=0; - - loadplugins(); - checkconfig(); + $config{syslog}=0 unless $config{dumpsetup}; } if ($config{dumpsetup}) { - loadplugins(); - checkconfig(); + require IkiWiki::Setup; IkiWiki::Setup::dump($config{dumpsetup}); } elsif ($config{wrapper}) {