Save one process by exec-ing custom man

This commit is contained in:
Fernando Schauenburg 2021-07-22 15:25:11 +02:00
parent e988871cba
commit 94ead9f9c8

View file

@ -4,20 +4,20 @@
Reset=$(tput sgr0) Reset=$(tput sgr0)
Base03=8 Base03=8
Base02=0 Base02=0
#Base01=10 Base01=10
#Base00=11 Base00=11
#Base0=12 Base0=12
#Base1=14 Base1=14
#Base2=7 Base2=7
Base3=15 Base3=15
#Red=1 Red=1
#Orange=9 Orange=9
Yellow=3 Yellow=3
#Green=2 Green=2
Cyan=6 Cyan=6
Blue=4 Blue=4
#Violet=13 Violet=13
#Magenta=5 Magenta=5
if [ "$BACKGROUND" = "light" ]; then if [ "$BACKGROUND" = "light" ]; then
standout=$( printf '%s\n' "setaf $Base3" "setab $Cyan" | tput -S) standout=$( printf '%s\n' "setaf $Base3" "setab $Cyan" | tput -S)
@ -29,12 +29,13 @@ else
underline=$(printf '%s\n' "setaf $Base3" "smul" | tput -S) underline=$(printf '%s\n' "setaf $Base3" "smul" | tput -S)
fi fi
LESS_TERMCAP_so="$standout" \ exec env \
LESS_TERMCAP_md="$bold" \ LESS_TERMCAP_so="$standout" \
LESS_TERMCAP_us="$underline" \ LESS_TERMCAP_md="$bold" \
LESS_TERMCAP_se="$Reset" \ LESS_TERMCAP_us="$underline" \
LESS_TERMCAP_me="$Reset" \ LESS_TERMCAP_se="$Reset" \
LESS_TERMCAP_ue="$Reset" \ LESS_TERMCAP_me="$Reset" \
GROFF_NO_SGR=1 \ LESS_TERMCAP_ue="$Reset" \
man "$@" GROFF_NO_SGR=1 \
man "$@"