gdiffmk
Section: User Commands (1)
Updated: 202-0-28
Index
Return to Main Contents
Name
gdiffmk - mark differences between
groff/
nroff/
troff
files
.nr d-fallback 1
.nr d-fallback 1
Synopsis
[
-a~ad-mark]
[
-c~chang-mark]
[
-d~delet-mark]
[
-x~dif-command]
[
-D
[
-B]
[
-M
mark1 mark2]]
[
--]
file1
file2
[
outpu-file]
--help
--version
Description
gdiffmk
compares two
documents,
file1
and
file2,
and writes another,
derived from both,
to the standard output stream
(or
outpu-file),
adding margin character
(
mc)
requests at places in the output
where the input documents differ.
gdiffmk
does not interpret the source documents;
it treats
roff
comments and nilpotent changes to formatting as meaningful.
For example,
it does not know that
[rs]h[aq]3m[aq],
[rs]h[aq](1~*~3m)[aq],
and
[rs]h[aq]3m+0[aq]
all mean the same thing.
If the
file1
or
file2
argument is
[lq]
-[rq],
gdiffmk
reads the standard input stream for that input.
If the
output
operand is present,
gdiffmk
writes output to a file of that name.
If it is
[lq]
-[rq]
or absent,
gdiffmk
writes output to the standard output stream.
[lq]
-[rq]
cannot be both an input and output operand.
Options
--help
displays a usage message
and
--version
shows version information;
both exit afterward.
- -a~ad-mark
-
Annotate material absent from
file1
but present in
file2
with
ad-mark
(default:
[lq]+[rq]).
- -B
-
Suppress
br
requests normally inserted by
-D
option.
Use with caution;
such requests are the only way to guarantee that deletions and small
changes are marked.
- -c~chang-mark
-
Annotate material differing between
file1
and
file2
with
chang-mark
(default:
[lq]|[rq]).
- -d~delet-mark
-
Annotate material present in
file1
but absent from
file2
with
delet-mark
(default:
[lq]*[rq]).
- -D
-
Mark changed and deleted material with surrounding delimiters.
- -M~mark1 mark2
-
Use
mark1
(default:
[lq][[[rq])
and
mark2
(default:
[lq]]][rq])
as delimiters when using the
-D
option.
- -x~dif-command
-
Use the
dif-command
program to perform the comparison of
file1
and
file2.
dif-command
(default:
diff)
must accept GNU
-D
extension option.
- --
-
Treat all subsequent arguments as file names,
even if they begin with
[lq]-[rq].
Exit status
gdiffmk
exits with
status~
0
if the input files are the same;
1
if they differ;
2
upon a usage error;
3
if the system's
or
commands do not support features
gdiffmk
requires;
and
4
if the
output
argument is a duplicate of
file1
or
file2.
Caveats
The output is not necessarily compatible with all macro packages or
preprocessors.
A reliable workaround is to run
gdiffmk
on the output of the final preprocessor instead of the input source.
gdiffmk
relies on the
-D
option of GNU
diff
to make a merged [lq]#ifdef[rq] output format.
Busybox
diff
is known to not support it.
Also see the
-x~dif-command
option.
Authors
gdiffmk
was written by
Mike Bianchi
now retired.
It is maintained by the
groff
developers.
See also
Index
- Name
-
- Synopsis
-
- Description
-
- Options
-
- Exit status
-
- Caveats
-
- Authors
-
- See also
-