about summary refs log tree commit diff
path: root/exman.sh
blob: f428e30cea28f4b343c416e592b4d179a87ebe7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 "$@"
=1'>Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe