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