diff --git a/usr.bin/diff3/diff3.1 b/usr.bin/diff3/diff3.1 --- a/usr.bin/diff3/diff3.1 +++ b/usr.bin/diff3/diff3.1 @@ -30,7 +30,7 @@ .\" @(#)diff3.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 25, 2017 +.Dd August 23, 2021 .Dt DIFF3 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd 3-way differential file comparison .Sh SYNOPSIS .Nm diff3 -.Op Fl 3aEeiXx +.Op Fl 3aEeiTXx .Op Fl Fl diff-program Ar program .Op Fl Fl strip-trailing-cr .Op Fl L | Fl Fl label Ar label1 @@ -115,6 +115,13 @@ .Ar file2 and .Ar file3 . +.It Fl T, Fl Fl initial-tab +In the normal listing, +use a tab instead of two spaces +at the beginning of each line. +In modes that produce an +.Xr ed 1 +script, this option changes nothing. .It Fl x, Fl Fl overlap-only Produces an output script suitable for .Xr ed 1 diff --git a/usr.bin/diff3/tests/1t.out b/usr.bin/diff3/tests/1t.out new file mode 100644 --- /dev/null +++ b/usr.bin/diff3/tests/1t.out @@ -0,0 +1,14 @@ +==== +1:2,3c + which multiple lines + and a few typ0s to fix +2:2,3c + which multiple lines + and a few typos to fix +3:2c + and a few typ0s to fix +====2 +1:4a +3:3a +2:5c + New line diff --git a/usr.bin/diff3/tests/Makefile b/usr.bin/diff3/tests/Makefile --- a/usr.bin/diff3/tests/Makefile +++ b/usr.bin/diff3/tests/Makefile @@ -10,6 +10,7 @@ 2.txt \ 3.txt \ 1.out \ + 1t.out \ 2.out \ 3.out \ 4.out \ diff --git a/usr.bin/diff3/tests/diff3_test.sh b/usr.bin/diff3/tests/diff3_test.sh --- a/usr.bin/diff3/tests/diff3_test.sh +++ b/usr.bin/diff3/tests/diff3_test.sh @@ -11,6 +11,9 @@ atf_check -o file:$(atf_get_srcdir)/1.out \ diff3 --strip-trailing-cr $(atf_get_srcdir)/1cr.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt + atf_check -o file:$(atf_get_srcdir)/1t.out \ + diff3 -T $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt + atf_check -o file:$(atf_get_srcdir)/2.out \ diff3 -e $(atf_get_srcdir)/1.txt $(atf_get_srcdir)/2.txt $(atf_get_srcdir)/3.txt