diff options
author | Igor Pashev <pashev@truth.(none)> | 2010-01-21 14:24:39 +0300 |
---|---|---|
committer | Igor Pashev <pashev@truth.(none)> | 2010-01-21 14:24:39 +0300 |
commit | 4f0202339437bea4d6cfde3a2872bef9c9a4d2ff (patch) | |
tree | 34ece972484b26661c450f7e3d779b62c83e9941 | |
parent | 09b828083bc9e5eafe351e1c6c562fafa06367ed (diff) | |
download | brainfuck-4f0202339437bea4d6cfde3a2872bef9c9a4d2ff.tar.gz |
Brainfuck to C wrapper
-rwxr-xr-x | bf2c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#!/bin/bash + +set -e +set -u + +BRAINFUCK=./brainfuck + +if [ $# != 0 ]; then + INDENT=$(which indent 2>/dev/null) + BF="$1" + C=${BF/.bf/.c} + shift + "$BRAINFUCK" -O -C "$@" "$BF" > "$C" + if [ -x "$INDENT" ]; then + "$INDENT" "$C" + fi +fi + +exit 0 + |