#!/bin/bash

# Bash script for running the Atari800 Emulator atari800stk.
# If -config option is specified execute atari800stk_bin with the
# given argument list otherwise append "-config .atari800stk.cfg"
# to set the default configuration file.

# Initialise the -config option found flag
bConFound="false"	

for a in "$@"
do
    if [ "$a" == "-config" ]
    then
	bConFound="true"
    fi
done

if [ $bConFound == "false" ]
then
    Command="atari800stk_bin $* -config $HOME/.atari800stk.cfg"
else
    Command="atari800stk_bin $*"
fi

exec $Command