diff3: document and test -T

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D31650
This commit is contained in:
Piotr Pawel Stefaniak 2021-08-23 21:33:27 +02:00
parent 76321d2d43
commit 9f7a81b133
4 changed files with 27 additions and 2 deletions

@ -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 @@ Defines labels to print instead of file names
.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

@ -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

@ -10,6 +10,7 @@ ${PACKAGE}FILES+= \
2.txt \
3.txt \
1.out \
1t.out \
2.out \
3.out \
4.out \

@ -11,6 +11,9 @@ diff3_body()
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