summaryrefslogtreecommitdiff
path: root/sys/man/1
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2020-09-21 09:40:42 -0700
committerOri Bernstein <ori@eigenstate.org>2020-09-21 09:40:42 -0700
commit8fe1d622b5b46dee51db6581282ec1fba76782b1 (patch)
treed7dca8fed3bc7ecf6e4fe1cb8e83fb0463befb71 /sys/man/1
parentaa7c8cac1145d0cd6e9117deaa1f8c9f418bca17 (diff)
diff: support unified diff via -u
The format produced by `diff -u` is inferior to that produced by `diff -c`, but it's what ape/patch and unix patch expect, so it's useful to generate it. This patch adds `diff -u`.
Diffstat (limited to 'sys/man/1')
-rw-r--r--sys/man/1/diff20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/man/1/diff b/sys/man/1/diff
index 91d3d491a..771ccc83f 100644
--- a/sys/man/1/diff
+++ b/sys/man/1/diff
@@ -4,7 +4,7 @@ diff \- differential file comparator
.SH SYNOPSIS
.B diff
[
-.B -abcefmnrw
+.B -abcefmnruw
]
.I file1 ... file2
.SH DESCRIPTION
@@ -143,6 +143,24 @@ The
.B -a
flag displays the entire file as context.
.PP
+The
+.B -u
+option provides a unix-compatible unified diff.
+This format is similar to that provided by
+.BR -c .
+However, the
+.L +
+and
+.L -
+prefixes are not separated from the rest of the line by spaces,
+and the file header is in the following format:
+.IP
+.EX
+--- filename.old
++++ filename.new
+@@ -line,len +line,len @@
+.EE
+.PP
Except in rare circumstances,
.I diff
finds a smallest sufficient set of file