19 lines
529 B
Bash
19 lines
529 B
Bash
BASEDIR=$(dirname "$0")
|
|
|
|
if command -v batcat >/dev/null 2>&1; then
|
|
# Save the original system `cat` under `rcat`
|
|
alias rcat=$(which cat)
|
|
|
|
# For Ubuntu and Debian-based `bat` packages
|
|
# the `bat` program is named `batcat` on these systems
|
|
alias cat=$(which batcat)
|
|
export MANPAGER="$BASEDIR/manbat batcat"
|
|
elif command -v bat >/dev/null 2>&1; then
|
|
# Save the original system `cat` under `rcat`
|
|
alias rcat=$(which cat)
|
|
|
|
# For all other systems
|
|
alias cat=$(which bat)
|
|
export MANPAGER="$BASEDIR/manbat bat"
|
|
fi
|