#!/bin/sh

_args='';

while [ -n "$1" ]
do
 k="$1";
 shift;

 case "$k" in
  '--')
   break;
  ;;
  '-h'|'--help')
   cat <<__AST2ROAR__END_OF_HELP_TEXT__
artsdsp.r - attempt to reroute audio device to RoarAudio

artsdsp.r [options] application arguments

options:
-h, --help                show brief help
-n, --name=NAME           use name to identify player to artsd
-s, --single-threaded     use the single-threaded version
__AST2ROAR__END_OF_HELP_TEXT__
   exit 0;
  ;;
  '-s')
  ;;
  '--single-threaded')
  ;;
  '-n')
   export ROAR_OSS_CLIENT_NAME="$1"
   shift;
  ;;
  '-n='*)
   _para=`echo "$k" | cut -d= -f2`;
   export ROAR_OSS_CLIENT_NAME="$_para"
  ;;
  '--name')
   export ROAR_OSS_CLIENT_NAME="$1"
   shift;
  ;;
  '--name='*)
   _para=`echo "$k" | cut -d= -f2`;
   export ROAR_OSS_CLIENT_NAME="$_para"
  ;;
  '-'*)
   echo "Unknown option" >&2;
   exit 1;
  ;;
  *)
   _args="$_args $k";
   break;
  ;;
 esac;
done

_args="$_args $*";

exec  $_args


#ll
