+++ /dev/null
-.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
-.\"
-.\" SPDX-License-Identifier: Linux-man-pages-copyleft
-.\"
-.TH diffman 1 (date) "Linux man-pages (unreleased)"
-.SH NAME
-diffman
-\-
-compare formatted manual pages line by line
-.SH SYNOPSIS
-.SY diffman
-.RI [ diff-options \~.\|.\|.\&]
-.I page1
-.I page2
-.YS
-.SH DESCRIPTION
-The
-.B diffman
-command
-formats two manual pages,
-and then runs
-.BR diff (1)
-on the formatted outputs.
-.P
-The pages are specified with the same syntax that
-.BR man (1)
-accepts.
-.P
-The output is suitable for piping to
-.IR less\~\-R .
-.SH OPTIONS
-.TP
-.B \-s
-Report when two files are the same.
-.TP
-.BI \-U n
-output
-.I n
-(default 3)
-lines of unified context.
-.TP
-.B \-w
-Ignore all white space.
-.SH ENVIRONMENT
-See
-.BR man (1).
-.SH EXAMPLES
-.EX
-.RB $\~ "diffman membarrier man2/membarrier.2 | less \-R" ;
-$
-.EE
-.SH SEE ALSO
-.BR diff (1),
-.BR man (1),
-.BR less (1)
+++ /dev/null
-#!/bin/bash
-#
-# Copyright 2024, Alejandro Colomar <alx@kernel.org>
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-set -Eeuo pipefail;
-shopt -s lastpipe;
-
-
-# Defaults:
-s='';
-u='-u';
-w='';
-
-
-err()
-{
- >&2 echo "$(basename "$0"): error: $*";
- exit 1;
-}
-
-
-while getopts "sU:w" opt; do
- case "$opt" in
- s) s='-s'; ;;
- U) u="-U$OPTARG"; ;;
- w) w='-w'; ;;
- \?) exit 1; ;;
- *) exit 1; ;;
- esac;
-done;
-shift $((OPTIND-1));
-
-
-if test $# -ne 2; then
- err "Expected two arguments.";
-fi;
-
-mktemp -t "a.XXXXXX" \
-| read -r t1;
-mktemp -t "b.XXXXXX" \
-| read -r 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.
-opts=($s $w $u);
-
-
-diff --label "$1" --label "$2" "${opts[@]}" "$t1" "$t2";