typo
[ikiwiki.git] / ikiwiki.pl
index c9b53a03181f3787aa13106ea2f9bf7033834206..ff1da353efe881937edd0f5d50a41d1ee6c2c0e5 100755 (executable)
@@ -3,7 +3,6 @@ $ENV{PATH}="/usr/local/bin:/usr/bin:/bin";
 delete @ENV{qw{IFS CDPATH ENV BASH_ENV}};
 
 package IkiWiki;
-our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE
 
 use warnings;
 use strict;
@@ -26,6 +25,7 @@ sub getconfig () { #{{{
                        "syslog!" => \$config{syslog},
                        "rebuild!" => \$config{rebuild},
                        "refresh!" => \$config{refresh},
+                       "render=s" => \$config{render},
                        "wrappers!" => \$config{wrappers},
                        "getctime" => \$config{getctime},
                        "wrappermode=i" => \$config{wrappermode},
@@ -33,6 +33,7 @@ sub getconfig () { #{{{
                        "no-rcs" => sub { $config{rcs}="" },
                        "anonok!" => \$config{anonok},
                        "rss!" => \$config{rss},
+                       "atom!" => \$config{atom},
                        "cgi!" => \$config{cgi},
                        "discussion!" => \$config{discussion},
                        "w3mmode!" => \$config{w3mmode},
@@ -45,6 +46,8 @@ sub getconfig () { #{{{
                        "svnpath" => \$config{svnpath},
                        "adminemail=s" => \$config{adminemail},
                        "timeformat=s" => \$config{timeformat},
+                       "sslcookie!" => \$config{sslcookie},
+                       "httpauth!" => \$config{httpauth},
                        "exclude=s@" => sub {
                                $config{wiki_file_prune_regexp}=qr/$config{wiki_file_prune_regexp}|$_[1]/;
                        },
@@ -66,16 +69,16 @@ sub getconfig () { #{{{
                        "disable-plugin=s@" => sub {
                                $config{plugin}=[grep { $_ ne $_[1] } @{$config{plugin}}];
                        },
-                       "pingurl" => sub {
+                       "pingurl=s" => sub {
                                push @{$config{pingurl}}, $_[1];
                        },
                        "version" => sub {
-                               print "ikiwiki version $version\n";
+                               print "ikiwiki version $IkiWiki::version\n";
                                exit;
                        },
                ) || usage();
 
-               if (! $config{setup}) {
+               if (! $config{setup} && ! $config{render}) {
                        loadplugins();
                        usage() unless @ARGV == 2;
                        $config{srcdir} = possibly_foolish_untaint(shift @ARGV);
@@ -99,7 +102,6 @@ sub main () { #{{{
        getconfig();
        
        if ($config{cgi}) {
-               lockwiki();
                loadindex();
                require IkiWiki::CGI;
                cgi();
@@ -113,6 +115,10 @@ sub main () { #{{{
                require IkiWiki::Wrapper;
                gen_wrapper();
        }
+       elsif ($config{render}) {
+               require IkiWiki::Render;
+               commandline_render();
+       }
        else {
                lockwiki();
                loadindex();