mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-11-08 00:34:22 +01:00
Update batman.sh to use the pager.sh library script
This commit is contained in:
parent
7cabaa620d
commit
e967497387
@ -7,11 +7,13 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
LIB="$(cd "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)/../lib"
|
||||
BAT="bat"
|
||||
source "${LIB}/pager.sh"
|
||||
source "${LIB}/print.sh"
|
||||
source "${LIB}/opt.sh"
|
||||
source "${LIB}/opt_hooks.sh"
|
||||
# -----------------------------------------------------------------------------
|
||||
hook_color
|
||||
hook_pager
|
||||
# -----------------------------------------------------------------------------
|
||||
MAN_ARGS=()
|
||||
BAT_ARGS=()
|
||||
@ -26,6 +28,12 @@ fi
|
||||
export MANPAGER='sh -c "col -bx | '"$(printf "%q" "$BAT")"' --language=man --style=grid '"${BAT_ARGS[@]}"'"'
|
||||
export MANROFFOPT='-c'
|
||||
|
||||
if [[ -n "${SCRIPT_PAGER_CMD}" ]]; then
|
||||
export BAT_PAGER="$(printf "%q " "${SCRIPT_PAGER_CMD}" "${SCRIPT_PAGER_ARGS[@]}")"
|
||||
else
|
||||
unset BAT_PAGER
|
||||
fi
|
||||
|
||||
command man "${MAN_ARGS[@]}"
|
||||
exit $?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user