From 9f7a81b133c715f649136dcd0ad004e4180c56c9 Mon Sep 17 00:00:00 2001 From: Piotr Pawel Stefaniak Date: Mon, 23 Aug 2021 21:33:27 +0200 Subject: [PATCH] diff3: document and test -T Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D31650 --- usr.bin/diff3/diff3.1 | 11 +++++++++-- usr.bin/diff3/tests/1t.out | 14 ++++++++++++++ usr.bin/diff3/tests/Makefile | 1 + usr.bin/diff3/tests/diff3_test.sh | 3 +++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 usr.bin/diff3/tests/1t.out diff --git a/usr.bin/diff3/diff3.1 b/usr.bin/diff3/diff3.1 index 22e04b6af5e8..2cf1e57cb74e 100644 --- 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 @@ 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 diff --git a/usr.bin/diff3/tests/1t.out b/usr.bin/diff3/tests/1t.out new file mode 100644 index 000000000000..fc54ce50286f --- /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 index 2ec7fbaab564..b8bea154944b 100644 --- a/usr.bin/diff3/tests/Makefile +++ b/usr.bin/diff3/tests/Makefile @@ -10,6 +10,7 @@ ${PACKAGE}FILES+= \ 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 index f4b5adf95700..64031b023187 100755 --- a/usr.bin/diff3/tests/diff3_test.sh +++ b/usr.bin/diff3/tests/diff3_test.sh @@ -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