]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - ikiwiki.in
Fix a couple of grammar errors.
[git.ikiwiki.info.git] / ikiwiki.in
index 801ff9a0bf0ad2ea5fcc79c019dd41955e366e5e..aa333793836455eb558f9151e43e96d35d5abb63 100755 (executable)
@@ -7,31 +7,39 @@ package IkiWiki;
 use warnings;
 use strict;
 use lib '.'; # For use in nonstandard directory, munged by Makefile.
 use warnings;
 use strict;
 use lib '.'; # For use in nonstandard directory, munged by Makefile.
-use IkiWiki;
+use IkiWiki 3.00;
 
 sub usage () {
        die gettext("usage: ikiwiki [options] source dest"), "\n",
            gettext("       ikiwiki --setup configfile"), "\n";
 }
 
 
 sub usage () {
        die gettext("usage: ikiwiki [options] source dest"), "\n",
            gettext("       ikiwiki --setup configfile"), "\n";
 }
 
+sub setup (@) {
+       require IkiWiki::Setup;
+       my $verbose=$config{verbose};
+       my $syslog=$config{syslog};
+       IkiWiki::Setup::load($_[1]);
+       $config{setupverbose}=$config{verbose};
+       $config{setupsyslog}=$config{syslog};
+       $config{verbose}=$verbose || $config{setupverbose};
+       $config{syslog}=$syslog;
+       $config{setup}=1;
+}
+
 sub getconfig () {
        if (! exists $ENV{WRAPPED_OPTIONS}) {
                %config=defaultconfig();
                eval q{use Getopt::Long};
                Getopt::Long::Configure('pass_through');
                GetOptions(
 sub getconfig () {
        if (! exists $ENV{WRAPPED_OPTIONS}) {
                %config=defaultconfig();
                eval q{use Getopt::Long};
                Getopt::Long::Configure('pass_through');
                GetOptions(
-                       "setup|s=s" => sub {
-                               require IkiWiki::Setup;
-                               my $verbose=$config{verbose};
-                               my $syslog=$config{syslog};
-                               IkiWiki::Setup::load($_[1]);
-                               $config{setupverbose}=$config{verbose};
-                               $config{setupsyslog}=$config{syslog};
-                               $config{verbose}=$verbose || $config{setupverbose};
-                               $config{syslog}=$syslog;
-                               $config{setup}=1;
-                       },
+                       "setup|s=s" => \&setup,
                        "dumpsetup|s=s" => \$config{dumpsetup},
                        "dumpsetup|s=s" => \$config{dumpsetup},
+                       "changesetup|s=s" => sub {
+                               $config{changesetup}=$_[1];
+                               $config{genwrappers}=1;
+                               $config{refresh}=1;
+                               setup(@_);
+                       },
                        "wikiname=s" => \$config{wikiname},
                        "verbose|v!" => \$config{verbose},
                        "syslog!" => \$config{syslog},
                        "wikiname=s" => \$config{wikiname},
                        "verbose|v!" => \$config{verbose},
                        "syslog!" => \$config{syslog},
@@ -45,7 +53,7 @@ sub getconfig () {
                        "usedirs!" => \$config{usedirs},
                        "prefix-directives!" => \$config{prefix_directives},
                        "getctime" => \$config{gettime},
                        "usedirs!" => \$config{usedirs},
                        "prefix-directives!" => \$config{prefix_directives},
                        "getctime" => \$config{gettime},
-                       "gettime" => \$config{gettime},
+                       "gettime!" => \$config{gettime},
                        "numbacklinks=i" => \$config{numbacklinks},
                        "rcs=s" => \$config{rcs},
                        "no-rcs" => sub { $config{rcs}="" },
                        "numbacklinks=i" => \$config{numbacklinks},
                        "rcs=s" => \$config{rcs},
                        "no-rcs" => sub { $config{rcs}="" },
@@ -85,7 +93,8 @@ sub getconfig () {
                                $config{wrappermode}=possibly_foolish_untaint($_[1])
                        },
                        "plugin=s@" => sub {
                                $config{wrappermode}=possibly_foolish_untaint($_[1])
                        },
                        "plugin=s@" => sub {
-                               push @{$config{add_plugins}}, $_[1];
+                               push @{$config{add_plugins}}, $_[1]
+                                       unless grep { $_ eq $_[1] } @{$config{add_plugins}};
                        },
                        "disable-plugin=s@" => sub {
                                push @{$config{disable_plugins}}, $_[1];
                        },
                        "disable-plugin=s@" => sub {
                                push @{$config{disable_plugins}}, $_[1];
@@ -181,6 +190,11 @@ sub main () {
                }
        }
 
                }
        }
 
+       if ($config{changesetup}) {
+               require IkiWiki::Setup;
+               IkiWiki::Setup::dump($config{changesetup});
+       }
+
        if ($config{dumpsetup}) {
                $config{srcdir}="" if ! defined $config{srcdir};
                $config{destdir}="" if ! defined $config{destdir};
        if ($config{dumpsetup}) {
                $config{srcdir}="" if ! defined $config{srcdir};
                $config{destdir}="" if ! defined $config{destdir};