]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - ikiwiki-calendar.in
Try revert operations (on a branch) before approving them
[git.ikiwiki.info.git] / ikiwiki-calendar.in
index cdfecff3f3a41e2c5c2ff3d2ef9230eb1453d6df..037ef7df44ee10acc15cca0965ac42d81a46f84e 100755 (executable)
@@ -7,7 +7,7 @@ use IkiWiki::Setup;
 use Getopt::Long;
 
 sub usage () {
-       die gettext("usage: ikiwiki-calendar [-f] your.setup [pagespec] [year]"), "\n";
+       die gettext("usage: ikiwiki-calendar [-f] your.setup [pagespec] [startyear [endyear]]"), "\n";
 }
 
 my $force=0;
@@ -15,7 +15,10 @@ GetOptions(
        "force" => \$force,
 ) || usage();
 my $setup=shift                || usage();
-my $pagespec=shift;
+my $pagespec;
+if (@ARGV && $ARGV[0] !~ /^\d+$/) {
+       $pagespec=shift;
+}
 my $startyear=shift    || 1900+(localtime(time))[5];
 my $endyear=shift      || $startyear;
 
@@ -56,7 +59,7 @@ foreach my $y ($startyear..$endyear) {
        }
 }
 
-IkiWiki::rcs_commit_staged(gettext("calendar update"), undef, undef)
+IkiWiki::rcs_commit_staged(message => gettext("calendar update"))
        if $config{rcs};
 
 exec("ikiwiki", "-setup", $setup, "-refresh");