From: Alejandro Colomar Date: Sun, 22 Dec 2024 14:08:42 +0000 (+0100) Subject: src/bin/diffman, man/man1/diffman.1: -s: Add support for diff(1)'s -s flag X-Git-Tag: man-pages-6.10~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b02d2c0fbcadb8484a9e45e7e8605a1e2c4c988;p=thirdparty%2Fman-pages.git src/bin/diffman, man/man1/diffman.1: -s: Add support for diff(1)'s -s flag Signed-off-by: Alejandro Colomar --- diff --git a/man/man1/diffman.1 b/man/man1/diffman.1 index fa4d21f02..e648f7b38 100644 --- a/man/man1/diffman.1 +++ b/man/man1/diffman.1 @@ -30,6 +30,9 @@ 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 diff --git a/src/bin/diffman b/src/bin/diffman index 16ce248ab..921905c7e 100755 --- a/src/bin/diffman +++ b/src/bin/diffman @@ -8,6 +8,7 @@ shopt -s lastpipe; # Defaults: +s=''; u='-u'; w=''; @@ -19,8 +20,9 @@ err() } -while getopts "U:w" opt; do +while getopts "sU:w" opt; do case "$opt" in + s) s='-s'; ;;& U) u="-U$OPTARG"; ;;& w) w='-w'; ;;& \?) exit 1; ;;& @@ -52,7 +54,7 @@ groff -man -Tutf8 <"$p2" >"$t2"; # shellcheck disable=SC2206 # We want only non-empty variables in the array. -opts=($w $u); +opts=($s $w $u); diff "${opts[@]}" "$t1" "$t2";