dwdiff accepts the following options (Note that all strings will first be escape expanded. All standard
\-escapes are supported, as well as \u and \U Unicode escapes):
-h, --help
Display a short help message.
-v, --version
Print version and copyright information.
-ddelimiters, --delimiters=delimiters
Specify a list of characters to be used as delimiters. The default is empty.
-P, --punctuation
Use punctuation characters as delimiters. The exact set of punctuation characters depends on the
current locale.
-Wwhitespace, --white-space=whitespace
Specify a list of characters to be used as whitespace. The default set of whitespace characters
depends on the current locale.
-u, --diff-input
Interpret the input as the output from diff in the Unified Diff format (usually produced by diff-u). In this case only one input file is allowed. This option allows reformating diff output with
dwdiff, and is useful for example to post-process the output of svndiff.
-1, --no-deleted
Suppress printing of words deleted from the first file.
-2, --no-inserted
Suppress printing of words inserted in the second file.
-3, --no-common
Suppress printing of words common to both files.
-L[width], --line-numbers[=width]
Show line numbers at the start of each line. The line numbers displayed are the line number in the
old file and the line number in the new file respectively. The optional width argument is the
minimum number of positions per line number.
-Cnum, --context=num
Show num lines of context before and after each changes. A line with only -- is printed between
blocks of changes.
-s, --statistics
Print statistics when done. The numbers printed include the number of words from in both files,
the number of deleted words, the number of inserted words, and the number of changed words. The
number of changed words is counted as the number of words that are removed from the first file,
and the number of words that replace them from the second file. All of these numbers are also
expressed as a percentage of the total number of words in the file the words came from.
-i, --ignore-case
Ignore differences in case when comparing words. This option is only available if the diff program
that is called provides it.
-I, --ignore-formatting
Ignore differences in formatting of characters. This option switches to using the Unicode
compatibility decomposition instead of the canonical decomposition. The compatibility
decomposition discards formatting information. For example, the ligature fi will be decomposed
into two separate characters for the purposes of comparison. However, also super- and subscript
will be regarded equal as well as different rotations of the same character.
-c[spec], --color[=spec]
Color mode. The optional spec can be used to customize the colors. spec consists of
[delete],[insert]. If either is omited it will be set to its default color (bright red or bright
green respectively). Both parts of the spec consist of [foreground][:background]. To obtain a list
of permissible color names, use the word ``list'' as spec. Alternatively, you can specify any
escape sequence to set attributes as a color by prepending e:.
The standard markers for the begin and end of deleted and inserted text are suppressed, but any
markers specified on the command line will still be printed.
-l, --less-mode
As -p but also overstrike deleted whitespace.
-p, --printer
Use overstriking with an underscore and bold text to emphasize changes. This is implemented by
first printing the underscore or a duplicate of the character to be printed, followed by a
backspace, followed by the character. On regular terminals you won't see any effect. The less(1)
command will however show underlined and bold text.
The standard markers for the begin and end of deleted and inserted text are suppressed, but any
markers specified on the command line will still be printed.
-mnum, --match-context=num
Use num words of context before and after words for matching. Words in the old text will then only
match words in the new text if words surrounding them are also equal. This improves the output for
dwdiff for large changes with frequently occurring words. However, using context requires more
disk space and more processing time. The default value is 1. Set this option to 0 to revert to the
pre 1.5 behavior.
--aggregate-changes
Allow multiple close changes to be treated as one change, if context words are used (see
--match-context). This option reduces the processing time as the changes reported by the diff
program are not post-processed to give more precise results.
-Aalgorithm, --algorithm=algorithm
Select the algorithm to be used for determining differences. There are three possible values for
algorithm: best, which tries to find the minimal set of changes, normal, which trades some
optimality for speed, and fast, which assumes that the input is large and contains few changes. By
default the normal algorithm is used.
-S[marker], --paragraph-separator[=marker]
Show insertion or deletion of blocks of lines with only whitespace characters. A special marker
is inserted into the output to indicate these blocks. The default marker is --.
--wdiff-output
Create wdiff compatible output. The dwdiff program uses a different output algorithm, which
provides a more intuitive output.
-wstring, --start-delete=string
Specify a string to mark begin of deleted text. The default is [-.
-xstring, --stop-delete=string
Specify a string to mark end of deleted text. The default is -].
-ystring, --start-insert=string
Specify a string to mark begin of inserted text. The default is {+.
-zstring, --stop-insert=string
Specify a string to mark end of inserted text. The default is +}.
-R, --repeat-markers
Repeat the begin and end markers at the start and end of line if a change crosses a newline.
--profile=name
Load the profile with name name from the .dwdiffrc file in the user's home directory. Only the
last profile named is actually read, unless it is followed by a --no-profile option. By default
the profile named default is read.
--no-profile
Disable reading of profiles, unless followed by another --profile option. This also disables
reading the default profile.
A single dash (-) as a file can be used to denote standard input. Only one file can be read from standard
input. To stop dwdiff from interpreting file names that start with a dash as options, one can specify a
double dash (--) after which dwdiff will interpret any following arguments as files to read.
The exit status of dwdiff indicates the result of the comparison: 0 if the files are the same, 1 if the
files are different. Should an error occur, dwdiff will exit with status 2.