NRCHBAR

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
BUGS
PRONUNCIATION
ETYMOLOGY
HISTORY
SEE ALSO

NAME

nrchbar − insert change bars in a n/troff file

SYNOPSIS

nrchbar [−a] [−b] [−c] [−d] [oldfile] newfile

DESCRIPTION

nrchbar inserts commands suitable for nroff(1) or troff(1) (hereafter, ‘‘*roff’’) to produce ‘‘change bars’’ denoting differences between oldfile and newfile. It sends the result to standard output.

If oldfile is not specified, nrchbar assumes that its standard input contains differences between oldfile and newfile in diff(1) format.

By default, nrchbar ignores changes to sections containing nothing but *roff commands, which it takes to be any lines beginning with ‘‘.’’. Use the −a option to apply change bars to *roff commands as well.

nrchbar inserts *roff .mc requests to provide the change bars. This places a character to the far right of each changed section. The character is a ‘‘+’’ for added sections, a ‘‘|’’ for modified sections, and a ‘‘-’’ for deleted sections.

By default, nrchbar removes the text of deleted sections. Use the −d option to preserve deleted text, surrounded by ‘‘[[’’ and ‘‘]]’’.

Also by default, nrchbar puts a break (.br) request after each changed section. This is the only way to guarantee that deletions and small changes get flagged. Use the −b option to omit breaks. The resulting text looks like a *roff’ed newfile, but means that some change bars won’t appear where they should.

OPTIONS

−a

Put change bars around all changed sections, even if they consist of nothing but *roff commands.

−b

Do not insert breaks after changed sections.

−c

Remove the first five lines of the diff output before processing (actually, remove as many lines as necessary until encountering a line beginning with the string ‘‘diff’’). This allows nrchbar to directly process output from cvs diff, using, for example, cvs diff foo.ms | nrchbar -c foo.ms.

−d

Show deleted text by preceding it with ‘‘[[’’ and following it with ‘‘]]’’.

BUGS

nrchbar knows nothing about the .cc request; It always assumes ‘‘.’’ is the control character.

The need for the −b hack would disappear if there were a way to tell *roff ‘‘Turn off the change bar character at immediately after you put out this one.’’ A horizontal .wh, perhaps?

There is no indicator for added text similar to ‘‘[[’’ and ‘‘]]’’ for deleted text.

There should be an option to use color to mark added and removed text. This would also remove the need for the −b hack and associated problems with the .mc request.

The .mc request doesn’t always work, especially with diversions. This is actually a *roff bug, but you ought to know about it. (This may be fixed in groff.)

nrchbar may mess up tables, lists, or displays. For a really polished change bar document, you may want to edit its output before sending it to *roff.

PRONUNCIATION

NERCH-bar

ETYMOLOGY

NRoff CHange BAR

HISTORY

The original version of nrchbar was written by Bob Lewis in March 1987 and posted in comp.sources.unix. This version is maintained by Larry Kollar (kollar@alltel.net).

SEE ALSO

nroff(1), troff(1), groff(1)