From: joey Date: Sun, 30 Jul 2006 07:41:26 +0000 (+0000) Subject: allow hooks to add options even to --setup X-Git-Tag: 1.13~22 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/0f45548333c19d33d885b4417fa85285d74f87cf allow hooks to add options even to --setup --- 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);