]> sipb.mit.edu Git - ikiwiki.git/blobdiff - ikiwiki.in
Add --set-yaml switch for setting more complex config file options.
[ikiwiki.git] / ikiwiki.in
index da5555629bbfd6bd1ff378752c2952d978c5feb3..7028bdb7d99d098175ed772060946bfc24023a4c 100755 (executable)
@@ -96,6 +96,15 @@ sub getconfig () {
                                }
                                $config{$var}=$val;
                        },
+                       "set-yaml=s" => sub {
+                               my ($var, $val)=split('=', $_[1], 2);
+                               if (! defined $var || ! defined $val) {
+                                       die gettext("usage: --set-yaml var=value"), "\n";
+                               }
+                               eval q{use YAML::Any};
+                               die $@ if $@;
+                               $config{$var}=Load($val);
+                       },
                        "version" => sub {
                                print "ikiwiki version $IkiWiki::version\n";
                                exit;