This allows using the environment variables that man(1) understands.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
.TP
.B \-w
Ignore all white space.
+.SH ENVIRONMENT
+See
+.BR man (1).
.SH EXAMPLES
.EX
.RB $\~ "diffman membarrier man2/membarrier.2 | less \-R" ;
err "Expected two arguments.";
fi;
-p1="$(man -w "$1")";
-p2="$(man -w "$2")";
-
printf '%s\n' "$1.XXXXXX" \
| sed 's,.*/,,' \
| xargs mktemp -t \
| xargs mktemp -t \
| read -r t2;
-preconv <"$p1" \
-| tbl \
-| eqn -Tutf8 \
-| troff -mandoc -Tutf8 \
-| grotty >"$t1";
-
-preconv <"$p2" \
-| tbl \
-| eqn -Tutf8 \
-| troff -mandoc -Tutf8 \
-| grotty >"$t2";
+test -v MAN_KEEP_FORMATTING \
+|| export MAN_KEEP_FORMATTING=1;
+
+man "$1" >"$t1";
+man "$2" >"$t2";
# shellcheck disable=SC2206 # We want only non-empty variables in the array.