config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit c1188490a85ebd2eb38465f27c7c1c6925da326d
parent 99f45188a18b46a7cdfd1057dbe7e9f484d43440
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Sun, 12 Sep 2021 15:10:26 -0700

Add man(1) wrapper to support plan9 manuals

As mandoc(1) doesn't properly render all plan9port manuals they
cannot simply be added to the search path, so this script calls
plan9port's man if the Unix man fails.

Additionally Unix man is made to act more closely to plan9port's
man by displaying all manuals by default, removing markup, and not
outputting to a pager.

This should have been added when 9term became the terminal, but I
forgot.

Diffstat:
Alocal/bin/bin/man | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/local/bin/bin/man b/local/bin/bin/man @@ -0,0 +1,14 @@ +#!/bin/ksh +# Copyright 2021 Jacob R. Edwards +# License: GPLv3 +# Unix and Plan9 man +# +# Since mandoc(1) doesn't properly render all plan9port manuals +# $PLAN9/man cannot simply be added to the search path and something +# like this must be done. + +set -o pipefail + +man() { "$(whereis man)" -c "$@" | col -b; } + +man -a "$@" 2>/dev/null || 9 man "$@"