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