aboutsummaryrefslogtreecommitdiff
path: root/textproc/cdiff/src/cdiff.sh
diff options
context:
space:
mode:
Diffstat (limited to 'textproc/cdiff/src/cdiff.sh')
-rw-r--r--textproc/cdiff/src/cdiff.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/textproc/cdiff/src/cdiff.sh b/textproc/cdiff/src/cdiff.sh
new file mode 100644
index 000000000000..690f28866cd0
--- /dev/null
+++ b/textproc/cdiff/src/cdiff.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+exec 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
+ if !s/^(--- \d+,\d+ ----.*)$/\033[1m$1\033[m/o;
+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