ryoakg
11/7/2015 - 9:11 PM

ccat

#! /bin/bash

opts="--failsafe -f esc"
style="--style-file=${HOME}/.source-highlight/wombat.style"

function f {
  source-highlight --lang-def=$2.lang ${opts} ${style} -i $1
}

for s in $1; do
  case $s in
    # *[Cc]hangeLog) f $s changelog ;;
    # *[Mm]akefile)  f $s makefile ;;
    *Gemfile) f $s ruby ;;
    *Gemfile|*.rake) f $s ruby ;;
    *profile|*shrc) f $s sh ;;
    *) source-highlight --infer-lang ${opts} ${style} -i $s ;;
  esac
done