Trim trailing whitespace

Otherwise `MANPAGER`'s trailing whitespace is escaped, which adds the next line of `export` as part of the command.

```bash
export MANPAGER=env\ BATMAN_IS_BEING_MANPAGER=yes\ bash\ /usr/local/bin/batman\
export MANROFFOPT=-c
```

and you get `cat: export: No such file or directory`
This commit is contained in:
Adrian Wilkins 2024-07-07 11:53:11 +01:00 committed by Ethan P.
parent 01c2f9bb94
commit 32706dd581

View File

@ -68,6 +68,7 @@ fi
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
if [[ -n "${MANPAGER}" ]]; then BAT_PAGER="$MANPAGER"; 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" "${FORWARDED_ARGS[@]}")"
export MANPAGER="${MANPAGER%"${MANPAGER##*[![:space:]]}"}"
export MANROFFOPT='-c' export MANROFFOPT='-c'
# If `--export-env`, print exports to use batman as the manpager directly. # If `--export-env`, print exports to use batman as the manpager directly.