fix for mandoc
This commit is contained in:
parent
a65c2e834a
commit
2d891a0851
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
prg="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
# mandoc passes a file name, other tools write to stdout
|
||||||
|
# using `cat "$@"` we take care of both reading from file and stdin
|
||||||
|
exec cat "$@" | col -bx | $prg --language man --style plain
|
|
@ -1,3 +1,4 @@
|
||||||
|
BASEDIR=$(dirname "$0")
|
||||||
|
|
||||||
if command -v batcat >/dev/null 2>&1; then
|
if command -v batcat >/dev/null 2>&1; then
|
||||||
# Save the original system `cat` under `rcat`
|
# Save the original system `cat` under `rcat`
|
||||||
|
@ -6,12 +7,12 @@ if command -v batcat >/dev/null 2>&1; then
|
||||||
# For Ubuntu and Debian-based `bat` packages
|
# For Ubuntu and Debian-based `bat` packages
|
||||||
# the `bat` program is named `batcat` on these systems
|
# the `bat` program is named `batcat` on these systems
|
||||||
alias cat=$(which batcat)
|
alias cat=$(which batcat)
|
||||||
export MANPAGER="sh -c 'col -bx | batcat -l man -p'"
|
export MANPAGER="$BASEDIR/manbat batcat"
|
||||||
elif command -v bat >/dev/null 2>&1; then
|
elif command -v bat >/dev/null 2>&1; then
|
||||||
# Save the original system `cat` under `rcat`
|
# Save the original system `cat` under `rcat`
|
||||||
alias rcat=$(which cat)
|
alias rcat=$(which cat)
|
||||||
|
|
||||||
# For all other systems
|
# For all other systems
|
||||||
alias cat=$(which bat)
|
alias cat=$(which bat)
|
||||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
export MANPAGER="$BASEDIR/manbat bat"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue