Skip to content

Commit

Permalink
batman: Forward color opts to bat
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bro committed Sep 17, 2024
1 parent 36c77c1 commit d762181
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/batman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ source "${LIB}/opt_hook_version.sh"
hook_color
hook_version
# -----------------------------------------------------------------------------
FORWARDED_ARGS=()
MAN_ARGS=()
BAT_ARGS=()
OPT_EXPORT_ENV=false
Expand All @@ -28,8 +27,7 @@ SHIFTOPT_SHORT_OPTIONS="SPLIT"
while shiftopt; do
case "$OPT" in
--export-env) OPT_EXPORT_ENV=true ;;
--paging|--pager|--wrap) shiftval; FORWARDED_ARGS+=("${OPT}=${OPT_VAL}");
BAT_ARGS+=("${OPT}=${OPT_VAL}") ;;
--paging|--pager|--wrap|--decorations) shiftval; BAT_ARGS+=("${OPT}=${OPT_VAL}") ;;
*) MAN_ARGS+=("$OPT") ;;
esac
done
Expand Down Expand Up @@ -67,7 +65,7 @@ fi

# -----------------------------------------------------------------------------
if [[ -n "${MANPAGER}" ]]; then BAT_PAGER="$MANPAGER"; fi
export MANPAGER="env BATMAN_IS_BEING_MANPAGER=yes bash $(printf "%q " "$SELF" "${FORWARDED_ARGS[@]}")"
export MANPAGER="env BATMAN_IS_BEING_MANPAGER=yes bash $(printf "%q " "$SELF" "${BAT_ARGS[@]}")"
export MANPAGER="${MANPAGER%"${MANPAGER##*[![:space:]]}"}"
export MANROFFOPT='-c'

Expand Down

0 comments on commit d762181

Please sign in to comment.