add new wiki to wikilist
[ikiwiki.git] / ikiwiki.in
index 0f82f77ac538a90cc8c7d7c3d3c6ab9f1433bb00..d8e848f8727c5dbfd11bc0f9ce976e0821b68cff 100755 (executable)
@@ -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}) {