xref: /netbsd/usr.bin/sdiff/sdiff.1 (revision 6550d01e)
1.\" $NetBSD: sdiff.1,v 1.1 2007/02/18 22:13:42 rmind Exp $
2.\"
3.\" Written by Raymond Lai <ray@cyth.net>.
4.\" Public domain.
5.\"
6.Dd October 29, 2005
7.Dt SDIFF 1
8.Os
9.Sh NAME
10.Nm sdiff
11.Nd side-by-side diff
12.Sh SYNOPSIS
13.Nm
14.Op Fl abdilstW
15.Op Fl I Ar regexp
16.Op Fl o Ar outfile
17.Op Fl w Ar width
18.Ar file1
19.Ar file2
20.Sh DESCRIPTION
21Shows a side-by-side comparison of two files.
22.Pp
23The options are:
24.Bl -tag -width Ds
25.It Fl l
26Only print the left column for identical lines.
27.It Fl o Ar outfile
28Interactively merge
29.Ar file1
30and
31.Ar file2
32into
33.Ar outfile .
34In this mode, the user is prompted for each set of differences.
35See
36.Ev EDITOR
37and
38.Ev VISUAL ,
39below,
40for details of which editor, if any, is invoked.
41.Pp
42The commands are as follows:
43.Bl -tag -width Ds
44.It Cm l
45Choose left set of diffs.
46.It Cm r
47Choose right set of diffs.
48.It Cm s
49Silent mode \(en identical lines are not printed.
50.It Cm v
51Verbose mode \(en identical lines are printed.
52.It Cm e
53Start editing an empty file, which will be merged into
54.Ar outfile
55upon exiting the editor.
56.It Cm e Cm l
57Start editing file with left set of diffs.
58.It Cm e Cm r
59Start editing file with right set of diffs.
60.It Cm e Cm b
61Start editing file with both sets of diffs.
62.It Cm q
63Quit
64.Nm .
65.El
66.It Fl s
67Skip identical lines.
68.It Fl w Ar width
69Print a maximum of
70.Ar width
71characters on each line.
72The default is 130 characters.
73.El
74.Pp
75Options passed to
76.Xr diff 1
77are:
78.Bl -tag -width Ds
79.It Fl a
80Treat
81.Ar file1
82and
83.Ar file2
84as text files.
85.It Fl b
86Ignore trailing blank spaces.
87.It Fl d
88Minimize diff size.
89.It Fl I Ar regexp
90Ignore line changes matching
91.Ar regexp .
92All lines in the change must match
93.Ar regexp
94for the change to be ignored.
95.It Fl i
96Do a case-insensitive comparison.
97.It Fl t
98Expand tabs to spaces.
99.It Fl W
100Ignore all spaces
101(the
102.Fl w
103flag is passed to
104.Xr diff 1 ) .
105.El
106.Sh ENVIRONMENT
107.Bl -tag -width Ds
108.It Ev EDITOR , VISUAL
109Specifies an editor to use with the
110.Fl o
111option.
112If both
113.Ev EDITOR
114and
115.Ev VISUAL
116are set,
117.Ev VISUAL
118takes precedence.
119If neither
120.Ev EDITOR
121nor
122.Ev VISUAL
123are set,
124the default is
125.Xr vi 1 .
126.It Ev TMPDIR
127Specifies a directory for temporary files to be created.
128The default is
129.Pa /tmp .
130.El
131.Sh SEE ALSO
132.Xr diff 1 ,
133.Xr diff3 1 ,
134.Xr vi 1 ,
135.Xr re_format 7
136.Sh AUTHORS
137.Nm
138was written from scratch for the public domain by
139.An Ray Lai Aq ray@cyth.net .
140.Sh CAVEATS
141Although undocumented,
142.Nm
143supports all options supported by GNU sdiff.
144Some options require GNU diff.
145.Pp
146Tabs are treated as anywhere from one to eight characters wide,
147depending on the current column.
148Terminals that treat tabs as eight characters wide will look best.
149.Sh BUGS
150.Nm
151may not work with binary data.
152