#
# Copyright (C) 2017, 2018 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
use warnings;
use strict;
if (@ARGV < 1) {
print STDERR <<'END';
END
exit 1;
}
my $FILE = shift;
my $DATE;
if (@ARGV >= 2) {
$DATE = shift
} else {
$DATE = `git log --max-count=1 --date=short --format='%cd' $FILE` or die "unable to determine last modification date of '$FILE'; specify on command line\nexiting";
}
chomp $DATE;
print <<END;
<!--
-
-->
<info>
</info>
</refentryinfo>
<refmeta>
</refmeta>
</refnamediv>
<docinfo>
END
for (my $y = 2004; $y <= $year; $y++) {
print " <year>$y</year>\n";
}
print <<END;
</copyright>
</docinfo>
</cmdsynopsis>
for
</para>
<para>
C style: /* */
</para>
<para>
</para>
<para>
</para>
</refsection>
END
# skip preamble
my $preamble = 0;
while (<FH>) {
if (m{^\s*$}) {
last if $preamble > 0;
} else {
$preamble++;
}
}
my $blank = 0;
while (<FH>) {
next;
}
s{ // not configured}{};
s{ // non-operational}{};
s{[[]}{[}g;
s{[]]}{]}g;
s{ }{\t}g;
if (m{^([a-z0-9-]+) }) {
my $HEADING = uc $1;
print <<END;
END
}
if (m{^\s*$} && !$blank) {
$blank = 1;
print <<END;
</refsection>
END
} else {
$blank = 0;
}
print;
}
print <<END;
</para>
</refsection>
<para><citerefentry>
</citerefentry>,
</citerefentry>,
</citerefentry>,
</citerefentry>,
</citerefentry>,
</para>
</refsection>
</refentry>
END