diff options
author | Eivind Eklund <eivind@FreeBSD.org> | 2000-10-24 16:51:16 +0000 |
---|---|---|
committer | Eivind Eklund <eivind@FreeBSD.org> | 2000-10-24 16:51:16 +0000 |
commit | 958509618fe1de3c638cbd841fa5754943a7b7a8 (patch) | |
tree | a52c91f07680b1ea84ce7ad7df79c5b56efb1a48 /textproc/cdiff | |
parent | Update to 0.2.1 (diff) |
Upgrade to 1.1.
This adds support for passing in URLs as arguments to cdiff.
You can now do
% cdiff http://people.freebsd.org/~eivind/find.diff
to retrieve and view a diff.
Notes
Notes:
svn path=/head/; revision=34195
Diffstat (limited to 'textproc/cdiff')
-rw-r--r-- | textproc/cdiff/Makefile | 4 | ||||
-rw-r--r-- | textproc/cdiff/src/cdiff.1 | 4 | ||||
-rw-r--r-- | textproc/cdiff/src/cdiff.sh | 18 |
3 files changed, 20 insertions, 6 deletions
diff --git a/textproc/cdiff/Makefile b/textproc/cdiff/Makefile index b2a251d72717..9be85310cd39 100644 --- a/textproc/cdiff/Makefile +++ b/textproc/cdiff/Makefile @@ -1,6 +1,6 @@ # New ports collection makefile for: cdiff # Date created: September 20th 2000 -# Whom: des +# Whom: eivind # # $FreeBSD$ # @@ -8,7 +8,7 @@ # PORTNAME= cdiff -PORTVERSION= 1.0 +PORTVERSION= 1.1 CATEGORIES= textproc MASTER_SITES= # none DISTFILES= # none diff --git a/textproc/cdiff/src/cdiff.1 b/textproc/cdiff/src/cdiff.1 index 8f4309741f5c..a399b04bf6c3 100644 --- a/textproc/cdiff/src/cdiff.1 +++ b/textproc/cdiff/src/cdiff.1 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2000 +.Dd October 24, 2000 .Dt CDIFF 1 .Sh NAME .Nm cdiff @@ -37,7 +37,7 @@ .Op Ar diff ... .Sh DESCRIPTION .Nm -reads a unidiff or context diff from stdin or from a set of files, adds color +reads a unidiff or context diff from stdin or a set of files and URLs, adds color codes, expands tabs to 8 spaces, and passes the results to .Xr less 1 . If used on a color terminal, it makes diffs much easier to read. diff --git a/textproc/cdiff/src/cdiff.sh b/textproc/cdiff/src/cdiff.sh index 690f28866cd0..6824cb89811c 100644 --- a/textproc/cdiff/src/cdiff.sh +++ b/textproc/cdiff/src/cdiff.sh @@ -1,5 +1,19 @@ #!/bin/sh -exec perl -pe ' +(if [ "$1" != "" ]; then + while [ "$1" != "" ]; do + case $1 in + http:*|https:*|ftp:*|file:*) + fetch -q -o - $1 + ;; + *) + cat $1 + ;; + esac + shift; + done +else + cat +fi) | perl -pe ' while (s/\t/" " x (8 - ((length($`)-1) % 8))/e) {} s/^(\+.*)$/\033[31m$1\033[m/o; s/^(-.*)$/\033[34m$1\033[m/o @@ -8,4 +22,4 @@ s/^(\*\*\* \d+,\d+ *\*\*\*.*)$/\033[1m$1\033[m/o; s/^(\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*)$/\033[1m$1\033[m/o; s/^(!.*)$/\033[35m$1\033[m/o; s/^(@@.*$)/\033[1m$1\033[m/o; -' $@ | less -r +' | less -r |