#!/bin/sh case "$1" in # Color diff files. *.diff | *.patch) < "$1" colordiff ;; *) # Display directory contents. if [ -d "$1" ]; then echo "=> Contents of $1:" ls "$1" exit 0 fi # We don't handle this format. exit 1 esac # No further processing by lesspipe necessary. exit 0