#!/bin/bash

task="$1"
input="$2"
output="$3"

if [[ "$task" = parse ]]; then
    java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy --pass=r --out "$output" "$input"
elif [[ "$task" = type ]]; then
    java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy --pass=.s --out "$output" "$input"
elif [[ "$task" = ass ]]; then
    java -cp "chocopy-ref.jar:target/assignment.jar" chocopy.ChocoPy --pass=.s --dir src/test/data/pa2/sample --test
fi

exit $?


