#!/usr/bin/sh
# The script favors the 64-bit executable!
[ ! "$#" = 1 ] && [ ! "$#" = 3 ] && \
    echo "/usr/bin/wine:: Number of arguments is unusual! Continuimg ..."
if [ "$#" = 1 ]; then
#   Windows format arguments: wine 'C:\PATH_TO_EXE'
    [ -x /usr/bin/wine64 ] && { wine64 "$1" ; } && exit 0
    [ -x /usr/bin/wine32 ] && { wine32 "$1" ; } && exit 0
elif [ "$#" = 3 ]; then
#   Unix format arguments: wine start /Unix '/home/user/path_to_exe'
    [ -x /usr/bin/wine64 ] && { wine64 "$1" "$2" "$3" ; } && exit 0
    [ -x /usr/bin/wine32 ] && { wine32 "$1" "$2" "$3" ; } && exit 0
else
    [ -x /usr/bin/wine64 ] && { wine64 $(for i;do echo "$i"; done) ; } && exit 0
    [ -x /usr/bin/wine32 ] && { wine32 $(for i;do echo "$i"; done) ; } && exit 0
fi
