merge_help.awk revision 199767f8919635c4928607450d9e0abb932109ce
#
# $FreeBSD$
#
# Merge two boot loader help files for FreeBSD 3.0
# Joe Abley <jabley@patho.gen.nz>
BEGIN \
{
state = 0;
first = -1;
ind = 0;
}
# beginning of first command
/^###/ && (state == 0) \
{
state = 1;
next;
}
# entry header
/^# T[[:graph:]]+ (S[[:graph:]]+ )*D[[:graph:]][[:print:]]*$/ && (state == 1) \
{
S = "";
# find a suitable place to store this one...
ind++;
if (ind == 1)
{
} else {
i = first; j = -1;
{
j = i;
if (i == -1) break;
}
if (i == -1)
{
} else {
if (j == -1)
else
}
}
# set our state
state = 2;
next;
}
# end of last command, beginning of next one
/^###/ && (state == 2) \
{
state = 1;
}
(state == 2) \
{
sub("[[:blank:]]+$", "");
next;
}
# show them what we have (it's already sorted in help[])
END \
{
while (node != -1)
{
}
}