allow hooks to add options even to --setup
parent
7e35ad2cd9
commit
0f45548333
|
@ -104,6 +104,12 @@ sub loadplugins () { #{{{
|
||||||
error("Failed to load plugin $mod: $@");
|
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 ($) { #{{{
|
sub error ($) { #{{{
|
||||||
|
|
6
ikiwiki
6
ikiwiki
|
@ -69,12 +69,6 @@ sub getconfig () { #{{{
|
||||||
|
|
||||||
if (! $config{setup}) {
|
if (! $config{setup}) {
|
||||||
loadplugins();
|
loadplugins();
|
||||||
run_hooks(getopt => sub { shift->() });
|
|
||||||
if (grep /^-/, @ARGV) {
|
|
||||||
print STDERR "Unknown option: $_\n"
|
|
||||||
foreach grep /^-/, @ARGV;
|
|
||||||
usage();
|
|
||||||
}
|
|
||||||
usage() unless @ARGV == 2;
|
usage() unless @ARGV == 2;
|
||||||
$config{srcdir} = possibly_foolish_untaint(shift @ARGV);
|
$config{srcdir} = possibly_foolish_untaint(shift @ARGV);
|
||||||
$config{destdir} = possibly_foolish_untaint(shift @ARGV);
|
$config{destdir} = possibly_foolish_untaint(shift @ARGV);
|
||||||
|
|
Loading…
Reference in New Issue