makeman revision 1.7 1 1.1 christos #!/bin/sh
2 1.7 lukem # $NetBSD: makeman,v 1.7 2023/07/21 15:00:32 lukem Exp $
3 1.1 christos #
4 1.1 christos # Copyright (c) 2000 The NetBSD Foundation, Inc.
5 1.1 christos # All rights reserved.
6 1.1 christos #
7 1.1 christos # This code is derived from software contributed to The NetBSD Foundation
8 1.1 christos # by Christos Zoulas.
9 1.1 christos #
10 1.1 christos # Redistribution and use in source and binary forms, with or without
11 1.1 christos # modification, are permitted provided that the following conditions
12 1.1 christos # are met:
13 1.1 christos # 1. Redistributions of source code must retain the above copyright
14 1.1 christos # notice, this list of conditions and the following disclaimer.
15 1.1 christos # 2. Redistributions in binary form must reproduce the above copyright
16 1.1 christos # notice, this list of conditions and the following disclaimer in the
17 1.1 christos # documentation and/or other materials provided with the distribution.
18 1.1 christos #
19 1.1 christos # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1 christos # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 christos # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 christos # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1 christos # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 christos # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 christos # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 christos # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 christos # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 christos # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 christos # POSSIBILITY OF SUCH DAMAGE.
30 1.1 christos
31 1.7 lukem : ${SED:=sed}
32 1.7 lukem
33 1.6 rillig tab=' '
34 1.1 christos
35 1.6 rillig list_messages() {
36 1.7 lukem ${SED} -E -n \
37 1.6 rillig -e 's|^'"$tab"'"(.+)",.*/\* '"$2"'([0-9]+) \*/$|\2'"$tab"'\1|p' \
38 1.6 rillig -e 's|^'"$tab"'"",.*/\* '"$2"'[0-9]+ \*/$|---'"$tab"'(no longer used)|p' \
39 1.6 rillig "$1" \
40 1.7 lukem | ${SED} -E \
41 1.6 rillig -e 's|\\"|"|g' \
42 1.6 rillig -e 's|\\\\|\\e|g' \
43 1.6 rillig -e "s|'|\\'|g" \
44 1.6 rillig -e 's|^|.It |'
45 1.6 rillig }
46 1.6 rillig
47 1.6 rillig # shellcheck disable=SC2016
48 1.7 lukem cvsid='$NetBSD: makeman,v 1.7 2023/07/21 15:00:32 lukem Exp $'
49 1.6 rillig date="$1"
50 1.6 rillig year="${date##* }"
51 1.6 rillig messages="$(list_messages "$2" "")"
52 1.6 rillig queries="$(list_messages "$2" "Q")"
53 1.6 rillig
54 1.6 rillig cat << EOF
55 1.6 rillig .\" $cvsid
56 1.1 christos .\"
57 1.6 rillig .\" Copyright (c) 2000,$year The NetBSD Foundation, Inc.
58 1.1 christos .\" All rights reserved.
59 1.1 christos .\"
60 1.1 christos .\" This code is derived from software contributed to The NetBSD Foundation
61 1.1 christos .\" by Christos Zoulas.
62 1.1 christos .\"
63 1.1 christos .\" Redistribution and use in source and binary forms, with or without
64 1.1 christos .\" modification, are permitted provided that the following conditions
65 1.1 christos .\" are met:
66 1.1 christos .\" 1. Redistributions of source code must retain the above copyright
67 1.1 christos .\" notice, this list of conditions and the following disclaimer.
68 1.1 christos .\" 2. Redistributions in binary form must reproduce the above copyright
69 1.1 christos .\" notice, this list of conditions and the following disclaimer in the
70 1.1 christos .\" documentation and/or other materials provided with the distribution.
71 1.1 christos .\"
72 1.1 christos .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
73 1.6 rillig .\" \`\`AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
74 1.1 christos .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
75 1.1 christos .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
76 1.1 christos .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
77 1.1 christos .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
78 1.1 christos .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
79 1.1 christos .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
80 1.1 christos .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
81 1.1 christos .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
82 1.1 christos .\" POSSIBILITY OF SUCH DAMAGE.
83 1.6 rillig .Dd $date
84 1.1 christos .Dt LINT 7
85 1.1 christos .Os
86 1.1 christos .Sh NAME
87 1.1 christos .Nm lint
88 1.6 rillig .Nd Error, warning and query messages from lint
89 1.1 christos .Sh DESCRIPTION
90 1.5 rillig The following is a list of message IDs and messages produced by
91 1.1 christos .Xr lint 1 .
92 1.6 rillig It is intended to be used with the
93 1.1 christos .Fl X
94 1.1 christos flag of
95 1.1 christos .Xr lint 1 .
96 1.1 christos .Pp
97 1.1 christos .Bd -ragged -offset indent -compact
98 1.2 christos .Bl -column "XXXX"
99 1.6 rillig $messages
100 1.6 rillig .El
101 1.6 rillig .Ed
102 1.6 rillig .Pp
103 1.6 rillig The following is a list of query IDs and their messages produced by
104 1.6 rillig .Xr lint 1 .
105 1.6 rillig It is intended to be used with the
106 1.6 rillig .Fl q
107 1.6 rillig flag of
108 1.6 rillig .Xr lint 1 .
109 1.6 rillig .Pp
110 1.6 rillig .Bd -ragged -offset indent -compact
111 1.6 rillig .Bl -column "XXXX"
112 1.6 rillig $queries
113 1.6 rillig .El
114 1.6 rillig .Ed
115 1.6 rillig EOF
116