batman: Add support for MANPAGER environment variable

This commit is contained in:
Ethan P 2020-02-15 15:10:18 -08:00
parent 4b17464c6e
commit 5cbbbb6ebc
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA
2 changed files with 12 additions and 0 deletions

View File

@ -12,6 +12,17 @@ A script that allows bat to be used as a manual highlighter.
**Environment:**
| Variable | Description |
| ---------- | ------------------------------------------------------------ |
| `MANPAGER` | Changes the pager used for `batman`. This is treated like `BAT_PAGER`, but only affects this command. |
## Caveats
None so far.

View File

@ -7,6 +7,7 @@
# -----------------------------------------------------------------------------
LIB="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo ".")")/../lib" && pwd)"
BAT="bat"
if [[ -n "${MANPAGER}" ]]; then BAT_PAGER="$MANPAGER"; fi
source "${LIB}/pager.sh"
source "${LIB}/print.sh"
source "${LIB}/opt.sh"