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