about summary refs log tree commit diff
path: root/exman.sh
diff options
context:
space:
mode:
Diffstat (limited to 'exman.sh')
-rw-r--r--exman.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/exman.sh b/exman.sh
new file mode 100644
index 0000000..f428e30
--- /dev/null
+++ b/exman.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -eu
+
+die() {
+	echo "$@" >&2
+	exit 1
+}
+
+script=$0
+path=${script%/*}
+prefix=${path%/bin}
+exman="${prefix}/share/exman"
+[ -d "${exman}" ] || exman=$prefix
+
+system=${1:-}
+[ -n "${system}" ] || die 'What system do you want?'
+shift
+
+export MANPATH="${exman}/${system}"
+[ -d "${MANPATH}" ] || die "No manuals for ${system}"
+
+export MANSECT=
+for sect in "${MANPATH}"/man*/; do
+	sect=${sect%/}
+	sect=${sect##*/man}
+	MANSECT="${MANSECT:-}${MANSECT:+:}${sect}"
+done
+
+exec man "$@"
>June McEnroe 2019-01-06Set background and max-width in exploreJune McEnroe 2019-01-06Swallow writes after the connection is closedJune McEnroe It was not okay. 2019-01-06Handle KCGI_HUPJune McEnroe I hope it's okay that I keep writing to the fwopen stream after streamWrite returns -1. 2019-01-06Install html filesJune McEnroe