Skip to content

Commit

Permalink
man pages: more battling with mandoc
Browse files Browse the repository at this point in the history
Turns out this bozo is not even smart enough to recognize
troff comments ... spaces at the end of comment lines even
trip it up.
  • Loading branch information
kmcdonell committed Apr 15, 2024
1 parent 6332e06 commit e172ff5
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 72 deletions.
5 changes: 5 additions & 0 deletions man/man3/pmdagetoptions.3
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,8 @@ will display the same error messages as
.BR pmdaDSO (3)
and
.BR pmdaText (3).

.\" control lines for scripts/man-spell
.\" +ok+ short_options helpfile logfile inet
.\" +ok+ pu [from example options string]
.\" +ok+ debugspec [from -D debugspec]
5 changes: 4 additions & 1 deletion man/man3/pmdahelp.3
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Other than error cases in
is not called.
.SH CAVEAT
The PMDA must be using
.B PMDA_PROTOCOL_2
.B PMDA_INTERFACE_2
or later, as specified in the call to
.BR pmdaDSO (3)
or
Expand All @@ -99,3 +99,6 @@ return NULL if the corresponding help text does not exist.
.BR pmdaText (3)
and
.BR pmErrStr (3).

.\" control lines for scripts/man-spell
.\" +ok+ pmdaHelp [from generic man page name]
2 changes: 1 addition & 1 deletion man/man3i/pmadeltaindom.3
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,5 @@ and
.BR pmaSameInDom (3).

.\" control lines for scripts/man-spell
.\" +ok+ pmaDeltaInDom pmaSameInDom pmaSortInDom
.\" +ok+ pmaDeltaInDom pmaSameInDom pmaSortInDom
.\" +ok+ new_delta namelist instlist numinst INDOM
2 changes: 1 addition & 1 deletion man/man5/LOGARCHIVE.5
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ and
.\" control lines for scripts/man-spell
.\" +ok+ PM_LOG_FEATURE_XXX
.\" +ok+ pmLogLabelSet TYPE_INDOM_V [from ...V2 or ...V3]
.\" +ok+ pmValueBlock
.\" +ok+ pmValueBlock
.\" +ok+ subrecords subsampled labelsets
.\" +ok+ pmLogText subrecord myarchive labelset unframed
.\" +ok+ __pmLog pmValue logmeta logutil INSITU endian JSONB pmapi
Expand Down
74 changes: 52 additions & 22 deletions man/naughty-boy
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,61 @@
# man pages squirreled away in the src directories
#

find man* -type f \
| while read f
usage="Usage: naughty-boy [-do] [file ...]"

tmp=/var/tmp/naughty-boy-$$
status=0
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

debug=false
oneshot=false
while getopts "do?" c
do
case `file $f`
case $c
in
*troff*)
if head -10 <$f | grep "[.'][T\\][H\"]" >/dev/null
then
# smells like troff ... not html, or an image, or ...
# + \<space> at the end of the line is an escaped <space>
# and that's not a problem
# + comments seem to be immune from this nonsense
#
cat -n $f \
| sed \
-e '/\\ $/d' \
-e '/^ *[0-9][0-9]*[ ][ ]*'"[.']"'\\"'/d \
| if grep ' $'
then
echo "... check failed for $f"
exit 1
fi
fi
d) # debug
debug=true
;;
o) # quit at first failure
oneshot=true
;;
?) echo >&2 "$usage"
exit
;;
esac
done
shift `expr $OPTIND - 1`

if [ $# -gt 0 ]
then
for arg; do echo $arg; done
else
find man* -type f
fi \
| while read f
do
if grep '^\.SH' <$f >/dev/null
then
# smells like troff man source ... not html, or an image, or ...
# + \<space> at the end of the line is an escaped <space>
# and that's not a problem
# + comments are NOT immune from this nonsense (I backed
# out the previous tricky sed to strip troff comment
# lines)
#
cat -n $f \
| sed \
-e '/\\ $/d' \
| if grep ' $' >$tmp.tmp
then
echo "$f:"
cat $tmp.tmp
status=1
$oneshot && exit 1
fi
else
$debug && echo "$f: skipped (not troff)"
fi
done

exit 0
exit
82 changes: 35 additions & 47 deletions scripts/man-spell
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ PCP_ETC_DIR
PCP_GROUP
PCP_HTML_DIR
PCP_INC_DIR
PCP_LIB32_DIR
PCP_LIB # from PCP_LIB32_DIR
PCP_LIBADM_DIR
PCP_LIB_DIR
PCP_LOG_DIR
Expand Down Expand Up @@ -187,27 +187,25 @@ stdpmid # from PCP_VAR/pmns/stdpmid
# PCP commands and PMDA executables
#
chkhelp
collectl # from pcp-collectl
collectl2pcp
collectl # from pcp-collectl or collectl2pcp
dbpmda
dkvis
elasticsearch # pcp2elasticsearch
eventlog # from pcp-eventlog
find-filter
ganglia2pcp
ganglia # from ganglia2pcp
genpmda
geolocate
indomcachectl
iostat2pcp
iostat # from iostat2pcp
json # from pcp2json
kube # from pcp-kube-pods
mkaf
mrtg2pcp
mrtg # from mrtg2pcp
newhelp
pcp
pcp-kube-pods
pcp-python
pcp-reboot-init
pcp-shping
python # from pcp-python
init # from pcp-reboot-init
shping # from pcp-shping
pcpcompat
pcpintro
perfalloc
Expand Down Expand Up @@ -263,8 +261,7 @@ pmfind_check
pmgenmap
pmgetopt
pmhostname
pmie
pmie2col
pmie # also from pmie2col
pmie_check
pmie_daily
pmie_dump_stats
Expand Down Expand Up @@ -326,9 +323,9 @@ pmtrace
pmval
pmview
runaspcp
sar2pcp
sheet2pcp
telnet-probe
sar # from sar2pcp
#ignore#sheet # from sheet2pcp
telnet # from telnet-probe
xlsx # from pcp2xlsx
xml # from pcp2xml
zabbix # from pcp2zabbix
Expand Down Expand Up @@ -385,9 +382,7 @@ LIMIT_AUTH_PDU
LIMIT_CLIENT_CALLBACKS
LIMIT_SIZE
LOCALHOSTNAME
LOG_PDU_VERSION
LOG_PDU_VERSION2
LOG_PDU_VERSION3
LOG_PDU_VERSION # from LOG_PDU_VERSION2 or LOG_PDU_VERSION3
LOG_REQUEST_NEWVOLUME
LOG_REQUEST_STATUS
LOG_REQUEST_SYNC
Expand Down Expand Up @@ -456,9 +451,9 @@ PDU_LABEL_REQ
PDU_LOG_CONTROL
PDU_LOG_REQUEST
PDU_LOG_STATUS
PDU_LOG_STATUS_V2
PDU_LOG_STATUS_V # from PDU_LOG_STATUS_V2
PDU_MAX
PDU_OVERRIDE2
PDU_OVERRIDE # from PDU_OVERRIDE2
PDU_PMNS_CHILD
PDU_PMNS_IDS
PDU_PMNS_NAMES
Expand All @@ -468,8 +463,7 @@ PDU_RESULT
PDU_START
PDU_TEXT
PDU_TEXT_REQ
PDU_VERSION
PDU_VERSION2
PDU_VERSION # from PDU_VERSION2
PMDAEVENTARRAY
PMLC_GET_AVAIL
PMLC_GET_DELTA
Expand Down Expand Up @@ -659,8 +653,8 @@ PM_VAL_INSITU
PM_VAL_SPTR
PM_VAL_VLEN_MAX
PM_XTB_FLAG
PM_XTB_GET(m)
PM_XTB_SET(m)
PM_XTB_GET
PM_XTB_SET
PROXY_PORT
PROXY_PROTOCOL
PTHREAD_STACK_MIN
Expand All @@ -674,10 +668,8 @@ TYPE_DESC
TYPE_INDOM
TYPE_INDOM_DELTA
TYPE_INDOM_V # V2 or V3
TYPE_INDOM_V2
TYPE_LABEL
TYPE_LABEL_V # v2 or V3
TYPE_LABEL_V2
TYPE_MAX
TYPE_TEXT
UNKNOWN_VERSION
Expand Down Expand Up @@ -742,7 +734,7 @@ __pmControlLog
__pmConvertHighResTime
__pmConvertTime
__pmCountPDUBuf
__pmCreateIPv6Socket
__pmCreateIPv # from __pmCreateIPv6Socket
__pmCreateSocket
__pmCreateUnixSocket
__pmDecodeAttr
Expand All @@ -751,15 +743,13 @@ __pmDecodeChildReq
__pmDecodeCreds
__pmDecodeDesc
__pmDecodeDescReq
__pmDecodeDescs
__pmDecodeDescs2
__pmDecodeDescs # also from __pmDecodeDescs2
__pmDecodeError
__pmDecodeFetch
__pmDecodeHighResFetch
__pmDecodeHighResResult
__pmDecodeHighResResult_ctx
__pmDecodeIDList
__pmDecodeIDList2
__pmDecodeIDList # also from __pmDecodeIDList2
__pmDecodeInstance
__pmDecodeInstanceReq
__pmDecodeLabel
Expand Down Expand Up @@ -811,7 +801,7 @@ __pmFD_SET
__pmFD_ZERO
__pmFaultInject
__pmFaultSummary
__pmFault_arm;
__pmFault_arm
__pmFault_calloc
__pmFault_malloc
__pmFault_realloc
Expand Down Expand Up @@ -941,13 +931,11 @@ __pmLogPutDesc
__pmLogPutInDom
__pmLogPutIndex
__pmLogPutLabels
__pmLogPutResult
__pmLogPutResult2
__pmLogPutResult3
__pmLogPutResult # also from __pmLogPutResult2 and __pmLogPutResult3
__pmLogPutText
__pmLogRead
__pmLogRead_ctx
__pmLogReads;
__pmLogReads
__pmLogSearchInDom
__pmLogUndeltaInDom
__pmLogVersion
Expand All @@ -964,7 +952,7 @@ __pmMemoryMap
__pmMemoryUnmap
__pmMktime
__pmMultiThreaded
__pmNativeConfig;
__pmNativeConfig
__pmNativePath
__pmNewPMNS
__pmOptFetchAdd
Expand All @@ -974,8 +962,8 @@ __pmOptFetchGetParams
__pmOptFetchPutParams
__pmOptFetchRedo
__pmOverrideLastFd
__pmPDUCntIn;
__pmPDUCntOut;
__pmPDUCntIn
__pmPDUCntOut
__pmPDUTypeStr
__pmPDUTypeStr_r
__pmParseCtime
Expand Down Expand Up @@ -1094,7 +1082,7 @@ __pmSockAddrFree
__pmSockAddrGetFamily
__pmSockAddrGetPort
__pmSockAddrInit
__pmSockAddrIsIPv6
__pmSockAddrIsIPv # from __pmSockAddrIsIPv6
__pmSockAddrIsInet
__pmSockAddrIsLoopBack
__pmSockAddrIsUnix
Expand Down Expand Up @@ -1425,7 +1413,7 @@ mmv_set
mmv_set_atomvalue
mmv_set_string
mmv_set_value
mmv_stats2_init
mmv_stats # from mmv_stats2_init
mmv_stats_add
mmv_stats_add_fallback
mmv_stats_add_indom
Expand Down Expand Up @@ -1799,6 +1787,8 @@ SIGXCPU
SIGXFSZ
__int # prefix from __int32_t or __int64_t
__uint # prefix from __uint32_t or __uint64_t
_inet_ntop # from win32_inet_ntop
_inet_pton # from win32_inet_pton
_t # suffix from __int32_t or __int64_t
alphasort
basename
Expand Down Expand Up @@ -1827,7 +1817,7 @@ gettimeofday
gmtime_r
index
localtime
lrand48
lrand # from lrand48
malloc
memcpy
mktime
Expand All @@ -1848,7 +1838,7 @@ sd_notify
setenv
setlinebuf
sleep
srand48
srand # from srand48
srandom
stderr
stdin
Expand All @@ -1872,8 +1862,6 @@ timeval # struct timeval
unsetenv
varargs
waitpid
win32_inet_ntop
win32_inet_pton
wsastrerror
ifdef # sh(1) and pmcpp(1) conditionals
Expand Down Expand Up @@ -2232,7 +2220,7 @@ p
echo >&2 "<empty file>"
fi
fi
[ $debug -gt 0 ] && echo "--- end debug output, misspelled words follow ---"
[ $debug -gt 0 ] && echo >&2 "--- end debug output, misspelled words follow ---"


# strip ...
Expand Down

0 comments on commit e172ff5

Please sign in to comment.