Lines 1-80
Link Here
|
1 |
.\"- |
|
|
2 |
.\" Copyright (c) 2000 Eivind Eklund |
3 |
.\" All rights reserved. |
4 |
.\" |
5 |
.\" Redistribution and use in source and binary forms, with or without |
6 |
.\" modification, are permitted provided that the following conditions |
7 |
.\" are met: |
8 |
.\" 1. Redistributions of source code must retain the above copyright |
9 |
.\" notice, this list of conditions and the following disclaimer |
10 |
.\" in this position and unchanged. |
11 |
.\" 2. Redistributions in binary form must reproduce the above copyright |
12 |
.\" notice, this list of conditions and the following disclaimer in the |
13 |
.\" documentation and/or other materials provided with the distribution. |
14 |
.\" 3. The name of the author may not be used to endorse or promote products |
15 |
.\" derived from this software without specific prior written permission. |
16 |
.\" |
17 |
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 |
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 |
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 |
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 |
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 |
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 |
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 |
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 |
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 |
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 |
.\" |
28 |
.\" $FreeBSD: textproc/cdiff/src/cdiff.1 300897 2012-07-14 14:29:18Z beat $ |
29 |
.\" |
30 |
.Dd October 24, 2000 |
31 |
.Dt CDIFF 1 |
32 |
.Sh NAME |
33 |
.Nm cdiff |
34 |
.Nd show diffs with colors |
35 |
.Sh SYNOPSIS |
36 |
.Nm cdiff |
37 |
.Op Fl m |
38 |
.Op Ar diff ... |
39 |
.Sh DESCRIPTION |
40 |
.Nm |
41 |
reads a unidiff or context diff from stdin or a set of (optionally compressed) |
42 |
files and URLs, adds color codes, expands tabs to 8 spaces, and passes the |
43 |
results to |
44 |
.Xr less 1 . |
45 |
If used on a color terminal, it makes diffs much easier to read. |
46 |
There is also handling of "cvs annotate" in it. |
47 |
.Pp |
48 |
.Bl -tag -width Ds |
49 |
.It Fl m |
50 |
Use bold, reverse and underline codes (for monochrome terminals). |
51 |
.El |
52 |
.Bl -tag -width CDIFFCOLORS |
53 |
.It Ev CDIFFCOLORS |
54 |
The color codes used to add. Default is 1:34:31:35, for lines begin with "@", "-", "+" and "!". |
55 |
.El |
56 |
.Sh AUTHORS |
57 |
.Nm |
58 |
was written by |
59 |
.An Eivind Eklund Aq eivind@FreeBSD.org . |
60 |
based on a sed line somebody passed around. The code is (much) smaller than |
61 |
this man page. |
62 |
.Sh SEE ALSO |
63 |
.Xr diff 1 , |
64 |
.Xr less 1 , |
65 |
.Xr cvs 1 . |
66 |
.Sh BUGS |
67 |
.Nm |
68 |
assumes standard ANSI color escape sequences (as used by xterm and most other |
69 |
commonly used terminals), rather than using |
70 |
.Xr curses 3 . |
71 |
.Pp |
72 |
.Nm |
73 |
should really be a large and complex C program based on |
74 |
.Xr less 1 |
75 |
and a diff library. This would allow a more informative display, including |
76 |
collapsing pure deletions/insertions inside a single line to one line with |
77 |
colors for deleted/added material, avoiding the line-wrap problems in less |
78 |
due to less not knowing the effects or lengths of the color escape codes, |
79 |
and correct handling of shifted tabs (instead of just expanding them to |
80 |
spaces.) |