]> sipb.mit.edu Git - ikiwiki.git/commitdiff
allow hooks to add options even to --setup
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 30 Jul 2006 07:41:26 +0000 (07:41 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 30 Jul 2006 07:41:26 +0000 (07:41 +0000)
IkiWiki.pm
ikiwiki

index b5707195b9dcf7c3dd41241fa185cf547a48850b..2face7082dc78e9be743fb65a91f29d36c56524b 100644 (file)
@@ -104,6 +104,12 @@ sub loadplugins () { #{{{
                        error("Failed to load plugin $mod: $@");
                }
        }
+       run_hooks(getopt => sub { shift->() });
+       if (grep /^-/, @ARGV) {
+               print STDERR "Unknown option: $_\n"
+                       foreach grep /^-/, @ARGV;
+               usage();
+       }
 } #}}}
 
 sub error ($) { #{{{
diff --git a/ikiwiki b/ikiwiki
index 6518b8626a943c24fa2947946c98b116d056d167..58f6af4ba521b460377f94a74742d3f424862ee4 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -69,12 +69,6 @@ sub getconfig () { #{{{
 
                if (! $config{setup}) {
                        loadplugins();
-                       run_hooks(getopt => sub { shift->() });
-                       if (grep /^-/, @ARGV) {
-                               print STDERR "Unknown option: $_\n"
-                                       foreach grep /^-/, @ARGV;
-                               usage();
-                       }
                        usage() unless @ARGV == 2;
                        $config{srcdir} = possibly_foolish_untaint(shift @ARGV);
                        $config{destdir} = possibly_foolish_untaint(shift @ARGV);