#!/bin/sh

for arg in "$@"; do
 	case "$arg" in
	-h|-help|--help) exec man openlugaru ;;
	-fullscreen) fullscreen="true" ;;
	esac
done

if ( [ -d "$HOME/.lugaru" ] && [ ! -e "$HOME/.openlugaru" ] ); then
	cp -a "$HOME/.lugaru" "$HOME/.openlugaru"
fi

cd /usr/lib/games/openlugaru || exit 1
if [ "$fullscreen" = "true" ]; then
	exec ./openlugaru ${1+"$@"}
else
	exec ./openlugaru -windowed -nomousegrab ${1+"$@"}
fi
