1DWDIFF(1) Delimited word diff program DWDIFF(1)
2
3
4
6 dwdiff - a delimited word diff program
7
9 dwdiff [OPTIONS] OLD FILE NEW FILE
10 dwdiff [OPTIONS] --diff-input [DIFF FILE]
11
13 dwdiff is a diff program that operates at the word level instead of the
14 line level. It is different from wdiff in that it allows the user to
15 specify what should be considered whitespace, and in that it takes an
16 optional list of characters that should be considered delimiters.
17 Delimiters are single characters that are treated as if they are words,
18 even when there is no whitespace separating them from preceding words
19 or delimiters. dwdiff is mostly command-line compatible with wdiff.
20 Only the --autopager, --terminal and --avoid-wraps options are not sup‐
21 ported.
22
23 The default output from dwdiff is the new text, with the deleted and
24 inserted parts annotated with markers. Command line options are avail‐
25 able to change both what is printed, and the markers.
26
28 dwdiff accepts the following options (Note that all strings will first
29 be escape expanded. All standard \-escapes are supported, as well as \u
30 and \U Unicode escapes):
31
32 -h, --help
33 Display a short help message.
34
35 -v, --version
36 Print version and copyright information.
37
38 -d delimiters, --delimiters=delimiters
39 Specify a list of characters to be used as delimiters.
40
41 -P, --punctuation
42 Use punctuation characters as delimiters. The exact set of punc‐
43 tuation characters depends on the current locale.
44
45 -W whitespace, --whitespace=whitespace
46 Specify a list of characters to be used as whitespace.
47
48 --diff-input
49 Interpret the input as the output from diff in the Unified Diff
50 format (usually produced by diff -u). In this case only one
51 input file is allowed. This option allows reformating diff out‐
52 put with dwdiff, and is useful for example to post-process the
53 output of svn diff.
54
55 -1, --no-deleted
56 Suppress printing of words deleted from the first file.
57
58 -2, --no-inserted
59 Suppress printing of words inserted in the second file.
60
61 -3, --no-common
62 Suppress printing of words common to both files.
63
64 -L[width], --line-numbers[=width]
65 Show line numbers at the start of each line. The line numbers
66 displayed are the line number in the old file and the line num‐
67 ber in the new file respectively. The optional width argument is
68 the minimum number of positions per line number.
69
70 -Cnum, --context=num
71 Show num lines of context before and after each changes. A line
72 with only -- is printed between blocks of changes.
73
74 -s, --statistics
75 Print statistics when done. The numbers printed include the num‐
76 ber of words from in both files, the number of deleted words,
77 the number of inserted words, and the number of changed words.
78 The number of changed words is counted as the number of words
79 that are removed from the first file, and the number of words
80 that replace them from the second file. All of these numbers are
81 also expressed as a percentage of the total number of words in
82 the file the words came from.
83
84 -i, --ignore-case
85 Ignore differences in case when comparing words. This option is
86 only available if the diff program that is called provides it.
87
88 -I, --ignore-formatting
89 Ignore differences in formatting of characters. This option
90 switches to using the Unicode compatibility decomposition
91 instead of the canonical decomposition. The compatibility
92 decomposition discards formatting information. For example, the
93 ligature fi will be decomposed into two separate characters for
94 the purposes of comparison. However, also super- and subscript
95 will be regarded equal as well as different rotations of the
96 same character.
97
98 -c[spec], --color[=spec]
99 Color mode. The optional spec can be used to customize the col‐
100 ors. spec consists of [delete],[insert]. If either is omited it
101 will be set to its default color (bright red or bright green
102 respectively). Both parts of the spec consist of [fore‐
103 ground][:background]. To obtain a list of permissible color
104 names, use the word ``list'' as spec. Alternatively, you can
105 specify any escape sequence to set attributes as a color by
106 prepending e:.
107
108 The standard markers for the begin and end of deleted and
109 inserted text are suppressed, but any markers specified on the
110 command line will still be printed.
111
112 -l, --less-mode
113 As -p but also overstrike deleted whitespace.
114
115 -p, --printer
116 Use overstriking with an underscore and bold text to emphasize
117 changes. This is implemented by first printing the underscore or
118 a duplicate of the character to be printed, followed by a
119 backspace, followed by the character. On regular terminals you
120 won't see any effect. The less(1) command will however show
121 underlined and bold text.
122
123 The standard markers for the begin and end of deleted and
124 inserted text are suppressed, but any markers specified on the
125 command line will still be printed.
126
127 -mnum, --match-context=num
128 Use num words of context before and after words for matching.
129 Words in the old text will then only match words in the new text
130 if words surrounding them are also equal. This improves the out‐
131 put for dwdiff for large changes with frequently occuring words.
132 However, using context requires more disk space and more pro‐
133 cessing time. The default value is 1. Set this option to 0 to
134 revert to the pre 1.5 behavior.
135
136 --aggregate-changes
137 Allow multiple close changes to be treated as one change, if
138 context words are used (see --match-context). This option
139 reduces the processing time as the changes reported by the diff
140 program are not post-processed to give more precise results.
141
142 -A algorithm, --algorithm=algorithm
143 Select the algorithm to be used for determining differences.
144 There are three possible values for algorithm: best, which tries
145 to find the minimal set of changes, normal, which trades some
146 optimality for speed, and fast, which assumes that the input is
147 large and contains few changes. By default the normal algorithm
148 is used.
149
150 -S[marker], --paragraph-separator[=marker]
151 Show insertion or deletion of blocks of lines with only white‐
152 space characters. A special marker is inserted into the output
153 to indicate these blocks. The default marker is --.
154
155 --wdiff-output
156 Create wdiff compatible output. The dwdiff program uses a dif‐
157 ferent output algorithm, which provides a more intuitive output.
158
159 -w string, --start-delete=string
160 Specify a string to mark begin of deleted text.
161
162 -x string, --stop-delete=string
163 Specify a string to mark end of deleted text.
164
165 -y string, --start-insert=string
166 Specify a string to mark begin of inserted text.
167
168 -z string, --stop-insert=string
169 Specify a string to mark end of inserted text.
170
171 -R, --repeat-markers
172 Repeat the begin and end markers at the start and end of line if
173 a change crosses a newline.
174
175 A single dash (-) as a file can be used to denote standard input. Only
176 one file can be read from standard input. To stop dwdiff from inter‐
177 preting file names that start with a dash as options, one can specify a
178 double dash (--) after which dwdiff will interpret any following argu‐
179 ments as files to read.
180
182 If you think you have found a bug, please check that you are using the
183 latest version of dwdiff <http://os.ghalkes.nl/dwdiff.html>. When
184 reporting bugs, please include a minimal example that demonstrates the
185 problem.
186
188 G.P. Halkes <dwdiff@ghalkes.nl>
189
191 Copyright © 2006-2011 G.P. Halkes and others
192 dwdiff is licensed under the GNU General Public License version 3.
193 For more details on the license, see the file COPYING in the documenta‐
194 tion directory. On Un*x systems this is usually
195 /usr/share/doc/dwdiff-2.0.9.
196
198 dwfilter(1), wdiff(1), diff(1)
199
200
201
2022.0.9 2013/03/10 DWDIFF(1)