114 lines
4.0 KiB
Bash
114 lines
4.0 KiB
Bash
#!/bin/sh
|
|
# $NetBSD: makeman,v 1.6 2022/07/05 22:50:41 rillig Exp $
|
|
#
|
|
# Copyright (c) 2000 The NetBSD Foundation, Inc.
|
|
# All rights reserved.
|
|
#
|
|
# This code is derived from software contributed to The NetBSD Foundation
|
|
# by Christos Zoulas.
|
|
#
|
|
# Redistribution and use in source and binary forms, with or without
|
|
# modification, are permitted provided that the following conditions
|
|
# are met:
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
# documentation and/or other materials provided with the distribution.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
tab=' '
|
|
|
|
list_messages() {
|
|
sed -E -n \
|
|
-e 's|^'"$tab"'"(.+)",.*/\* '"$2"'([0-9]+) \*/$|\2'"$tab"'\1|p' \
|
|
-e 's|^'"$tab"'"",.*/\* '"$2"'[0-9]+ \*/$|---'"$tab"'(no longer used)|p' \
|
|
"$1" \
|
|
| sed -E \
|
|
-e 's|\\"|"|g' \
|
|
-e 's|\\\\|\\e|g' \
|
|
-e "s|'|\\'|g" \
|
|
-e 's|^|.It |'
|
|
}
|
|
|
|
# shellcheck disable=SC2016
|
|
cvsid='$NetBSD: makeman,v 1.6 2022/07/05 22:50:41 rillig Exp $'
|
|
date="$1"
|
|
year="${date##* }"
|
|
messages="$(list_messages "$2" "")"
|
|
queries="$(list_messages "$2" "Q")"
|
|
|
|
cat << EOF
|
|
.\" $cvsid
|
|
.\"
|
|
.\" Copyright (c) 2000,$year The NetBSD Foundation, Inc.
|
|
.\" All rights reserved.
|
|
.\"
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
.\" by Christos Zoulas.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
.\" \`\`AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
.Dd $date
|
|
.Dt LINT 7
|
|
.Os
|
|
.Sh NAME
|
|
.Nm lint
|
|
.Nd Error, warning and query messages from lint
|
|
.Sh DESCRIPTION
|
|
The following is a list of message IDs and messages produced by
|
|
.Xr lint 1 .
|
|
It is intended to be used with the
|
|
.Fl X
|
|
flag of
|
|
.Xr lint 1 .
|
|
.Pp
|
|
.Bd -ragged -offset indent -compact
|
|
.Bl -column "XXXX"
|
|
$messages
|
|
.El
|
|
.Ed
|
|
.Pp
|
|
The following is a list of query IDs and their messages produced by
|
|
.Xr lint 1 .
|
|
It is intended to be used with the
|
|
.Fl q
|
|
flag of
|
|
.Xr lint 1 .
|
|
.Pp
|
|
.Bd -ragged -offset indent -compact
|
|
.Bl -column "XXXX"
|
|
$queries
|
|
.El
|
|
.Ed
|
|
EOF
|