aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-07-30 07:41:26 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-07-30 07:41:26 +0000
commit0f45548333c19d33d885b4417fa85285d74f87cf (patch)
treeada30fde9eeb99fbe5c238ff20ea30857b99d190
parent7e35ad2cd91a1abc20b7baff30d8c9e713e9d1e9 (diff)
downloadikiwiki-0f45548333c19d33d885b4417fa85285d74f87cf.tar
ikiwiki-0f45548333c19d33d885b4417fa85285d74f87cf.tar.gz
allow hooks to add options even to --setup
-rw-r--r--IkiWiki.pm6
-rwxr-xr-xikiwiki6
2 files changed, 6 insertions, 6 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index b5707195b..2face7082 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -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 6518b8626..58f6af4ba 100755
--- 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);