Browse Source

Added code pretty printer script

Samuel W. Flint 7 years ago
parent
commit
22a811cf55
1 changed files with 19 additions and 0 deletions
  1. 19 0
      pretty-print-code

+ 19 - 0
pretty-print-code

@@ -0,0 +1,19 @@
+#!/bin/sh
+
+if [ $# -lt 3 ] ; then
+    echo "pretty-print-code lang output input"
+    exit
+fi
+
+LANGUAGE=$1
+shift
+OUTPUTPDF=$1
+shift
+INPUT=$1
+shift
+
+OUTPUTPS=$(basename $OUTPUTPDF .pdf).ps
+
+a2ps -1rCB -l 120 --center-title='$n' --right-footer="%Q" --borders=no -E$LANGUAGE -o $OUTPUTPS $INPUT
+ps2pdf $OUTPUTPS
+rm $OUTPUTPS