diff options
author | eivind <eivind@FreeBSD.org> | 2000-10-25 00:51:16 +0800 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 2000-10-25 00:51:16 +0800 |
commit | 0349de2ce0a7a0bc13c8ea3fff589444e4471d63 (patch) | |
tree | 8188ceb5644b14e653c296e30cd9b1d9990bdf23 /textproc | |
parent | 82800d792da27ff1617519e1c58b9fe640b89501 (diff) | |
download | freebsd-ports-graphics-0349de2ce0a7a0bc13c8ea3fff589444e4471d63.tar.gz freebsd-ports-graphics-0349de2ce0a7a0bc13c8ea3fff589444e4471d63.tar.zst freebsd-ports-graphics-0349de2ce0a7a0bc13c8ea3fff589444e4471d63.zip |
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.
Diffstat (limited to 'textproc')
-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 b2a251d7271..9be85310cd3 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 8f4309741f5..a399b04bf6c 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 690f28866cd..6824cb89811 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 |