]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/diffman, man/man1/diffman.1: -s: Add support for diff(1)'s -s flag
authorAlejandro Colomar <alx@kernel.org>
Sun, 22 Dec 2024 14:08:42 +0000 (15:08 +0100)
committerAlejandro Colomar <alx@kernel.org>
Sun, 22 Dec 2024 14:08:42 +0000 (15:08 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man1/diffman.1
src/bin/diffman

index fa4d21f022dd55cf46dbeb3631d569f0797a602f..e648f7b3829aef3dbd9c9904ce9c0ce71a4486c2 100644 (file)
@@ -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
index 16ce248ab30263830f97025b78dd23ee5f260600..921905c7ed7c016e783bda917731af07296c153f 100755 (executable)
@@ -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";