A replacement for [c]at with automatic syntax highlighting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

25 lines
461 B

#!/bin/sh
VERSION="0.5.2"
usage() {
echo "Usage: $(basename $0) [-Vh]"
echo ""
echo "The available options are documented in \"c -h\"!"
}
version() {
echo "$(basename $0) $VERSION"
}
[ "$1" = "-h" ] && usage && exit 0
[ "$1" = "-V" ] && version && exit 0
if ! which fzf >& /dev/null; then
echo "fzf is not available in PATH!"
echo "Please install fzf:"
echo "https://github.com/junegunn/fzf"
exit 1
fi
fzf | xargs c "$@"