blob: 85611dd524928459b82837d0b9caf67155cc491d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
.\" $OpenBSD: sdiff.1,v 1.5 2005/12/27 12:45:57 jmc Exp $
.\"
.\" Written by Raymond Lai <ray@cyth.net>.
.\" Public domain.
.\"
.Dd October 29, 2005
.Dt SDIFF 1
.Os
.Sh NAME
.Nm sdiff
.Nd side-by-side diff
.Sh SYNOPSIS
.Nm
.Op Fl abdilstW
.Op Fl I Ar regexp
.Op Fl o Ar outfile
.Op Fl w Ar width
.Ar file1
.Ar file2
.Sh DESCRIPTION
Shows a side-by-side comparison of two files.
.Pp
The options are:
.Bl -tag -width Ds
.It Fl l
Only print the left column for identical lines.
.It Fl o Ar outfile
Interactively merge
.Ar file1
and
.Ar file2
into
.Ar outfile .
In this mode, the user is prompted for each set of differences.
.Pp
The commands are as follows:
.Bl -tag -width Ds
.It Cm l
Choose left set of diffs.
.It Cm r
Choose right set of diffs.
.It Cm s
Silent mode \(en identical lines are not printed.
.It Cm v
Verbose mode \(en identical lines are printed.
.It Cm e
Start editing an empty file, which will be merged into
.Ar outfile
upon exiting the editor.
.It Cm e Cm l
Start editing file with left set of diffs.
.It Cm e Cm r
Start editing file with right set of diffs.
.It Cm e Cm b
Start editing file with both sets of diffs.
.It Cm q
Quit
.Nm .
.El
.It Fl s
Skip identical lines.
.It Fl w Ar width
Print a maximum of
.Ar width
characters on each line.
The default is 130 characters.
.El
.Pp
Options passed to
.Xr diff 1
are:
.Bl -tag -width Ds
.It Fl a
Treat
.Ar file1
and
.Ar file2
as text files.
.It Fl b
Ignore trailing blank spaces.
.It Fl d
Minimize diff size.
.It Fl I Ar regexp
Ignore line changes matching
.Ar regexp .
.It Fl i
Do a case-insensitive comparison.
.It Fl t
Expand tabs to spaces.
.It Fl W
Ignore all spaces
(the
.Fl w
flag is passed to
.Xr diff 1 ) .
.El
.Sh SEE ALSO
.Xr diff 1 ,
.Xr diff3 1
.Sh AUTHORS
.Nm
was written from scratch for the public domain by
.An Ray Lai Aq ray@cyth.net .
.Sh CAVEATS
Although undocumented,
.Nm
supports all options supported by GNU sdiff.
Some options require GNU diff.
.Pp
Tabs are treated as anywhere from one to eight characters wide,
depending on the current column.
Terminals that treat tabs as eight characters wide will look best.
|