]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/diffman, diffman.1: -U: Add support for diff(1)'s -U option
authorAlejandro Colomar <alx@kernel.org>
Fri, 6 Dec 2024 15:04:46 +0000 (16:04 +0100)
committerAlejandro Colomar <alx@kernel.org>
Fri, 6 Dec 2024 15:09:11 +0000 (16:09 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man1/diffman.1
src/bin/diffman

index 7e1869b31c09fb729b6b5355c6664200fa96ade1..fa4d21f022dd55cf46dbeb3631d569f0797a602f 100644 (file)
@@ -30,6 +30,12 @@ The output is suitable for piping to
 .IR less\~\-R .
 .SH OPTIONS
 .TP
+.BI \-U n
+output
+.I n
+(default 3)
+lines of unified context.
+.TP
 .B \-w
 Ignore all white space.
 .SH EXAMPLES
index c4f31359e60e31863eead712377ab5e9c1a5755a..b94ac8e75a1dee0390f800c33f42ade88db0b96c 100755 (executable)
@@ -8,6 +8,7 @@ shopt -s lastpipe;
 
 
 # Defaults:
+u='-u';
 w='';
 
 
@@ -18,8 +19,9 @@ err()
 }
 
 
-while getopts "w" opt; do
+while getopts "U:w" opt; do
        case "$opt" in
+       U)      u="-U$OPTARG";  ;;&
        w)      w='-w';         ;;&
        \?)     exit 1;         ;;&
        esac;
@@ -48,7 +50,7 @@ groff -man -Tutf8 <"$p1" >"$t1";
 groff -man -Tutf8 <"$p2" >"$t2";
 
 
-opts=($w -u);
+opts=($w $u);
 
 
 diff "${opts[@]}" "$t1" "$t2";