Hi Alexis of the flexible beast, At 2026-02-28T17:01:19+1100, Alexis wrote: > "G. Branden Robinson" <[email protected]> writes: > > # Search for a word in a given man page. > > # > > # Equivalent examples (if using man-db man): tagman am 7 groff > > # tagman am > > 'groff(7)' > > # tagman am -s 7 > > groff > > tagman () { > > word=$1 > > shift > > man "$@" | "${PAGER:-less}" -c > > '+/[^a-zA-Z0-9]'"$word"'[^a-zA-Z0-9]' > > } > > As a data point, this nifty function overall worked for me with mandoc > man(1) as well, although: > > * mandoc man(1) doesn't like 'groff(7)' as an argument, resulting in > a "No entry for groff(7) in the manual" error. (`man 7 groff` > works fine.)
Right. Support for that form of man page specification is unique to man-db man, as far as I know. Colin Watson would be the authority here. > * i've been trialing using most(1) instead of less(1), and the > function doesn't work with the former. Sounds like it doesn't attempt to support even the relatively small number of command-line options specified for more(1) by the POSIX standard. https://pubs.opengroup.org/onlinepubs/9799919799/utilities/more.html Maybe doing so is not part of its mission, or the program simply needs further development. Regards, Branden
signature.asc
Description: PGP signature
