Module Name: othersrc Committed By: agc Date: Tue Jan 15 01:46:04 UTC 2013
Modified Files: othersrc/external/bsd/netdiff/bin: Makefile othersrc/external/bsd/netdiff/dist: diff_subr.c diffreg.c netdiff.h netwdiff.1 netwdiff.c Log Message: Add support to netwdiff to specify the insert and delete region character sequences from the command line via the -w, -x, -y and -z args. The default is, as before, "[- ... -]" for deleted regions, and "{+ ... +}" for inserted text. With this in place, the arguments can be used to highlight word diffs portably across shells: csh/tcsh: % set ansi_red = "`printf '\e[31m'`" % set ansi_end = "`printf '\e[0m'`" % set ansi_green = "`printf '\e[32m'`" sh/ksh/bash/zsh: $ ansi_red="$(printf '\e[31m')" $ ansi_end="$(printf '\e[0m')" $ ansi_green="$(printf '\e[32m')" and then in all shells: netwdiff -w $ansi_red -x $ansi_end -y $ansi_green -z $ansi_end f1 f2 -- this will highlight deleted words in red, and added words in green, on standard ANSI terminals. This gets around bash's twee $'' idiom for tputs sequences. Thanks to Christos Zoulas for setting me straight on this, and thanks also to Alan Barrett for the nudge to implement the region arguments. Thanks to all of the people who pointed me to comm(1)'s arguments as being the model for wdiff's inhibit. My apologies, I should have thought of that. I'm still trying to work out the model for the choice of -w/-x/-y/-z; all suggestions gratefully received. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/netdiff/bin/Makefile cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/netdiff/dist/diff_subr.c cvs rdiff -u -r1.6 -r1.7 othersrc/external/bsd/netdiff/dist/diffreg.c cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/netdiff/dist/netdiff.h cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/netdiff/dist/netwdiff.1 cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/netdiff/dist/netwdiff.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.