about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.gitignore1
-rw-r--r--Makefile2
-rw-r--r--exman.sh29
3 files changed, 31 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 066e06a..8f9e5a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 *.tar
+exman
 freebsd/
 linux/
 netbsd/
diff --git a/Makefile b/Makefile
index 226657a..5c9b086 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ SYSTEMS += netbsd
 SYSTEMS += openbsd
 SYSTEMS += posix
 
-all: ${SYSTEMS}
+all: exman ${SYSTEMS}
 
 .SUFFIXES: .tar .url
 
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 "$@"
ow=1'>Remove unneeded includes in ui.cJune McEnroe 2022-02-19Reimplement tab completeJune McEnroe 2022-02-19Handle errors from editFn, etc.June McEnroe 2022-02-19Reimplement text macrosJune McEnroe 2022-02-19Factor out input handling to input.cJune McEnroe 2022-02-19Factor out window management to window.cJune McEnroe 2022-02-19Enable -Wmissing-prototypesJune McEnroe 2022-02-19Fix edit.[ch] license notice additional permissionsJune McEnroe 2022-02-19Run line editing testsJune McEnroe 2022-02-18Implement new line editing "library"June McEnroe 2022-02-18Simplify cursor positioning in inputJune McEnroe 2022-02-18Fix M-f orderingJune McEnroe 2022-02-12Move sandman build to scripts/MakefileJune McEnroe 2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe 2022-02-12Copy RPP defines from oconfigureJune McEnroe