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