#! /usr/bin/env bash

################################################################################

cmake_source_dir="@CMAKE_SOURCE_DIR@"
cmake_binary_dir="@CMAKE_BINARY_DIR@"

panic()
{
	echo "ERROR: $*"
	exit 1
}

print_separator()
{
	python -c 'print("*" * 80)'
}

source_dir="$cmake_source_dir"
build_dir="$cmake_binary_dir"
data_dir="$source_dir/data"
#run_clang_tool="$source_dir/run_clang_tool"

################################################################################

app="$build_dir/app"

run_program_with_args()
{
	echo "RUNNING: $app $*"
	"$app" -p "$build_dir" "$@" || panic "program failed"
}

run_program_with_args --help
print_separator
run_program_with_args test hello.cpp
print_separator
run_program_with_args -o output.txt test hello.cpp
print_separator
run_program_with_args -v test hello.cpp
print_separator
run_program_with_args -verbose test hello.cpp
print_separator
run_program_with_args -foobar test hello.cpp
print_separator
