#!/bin/bash

usage()
{
cat << EO
Usage: $0 [-t|--tree] | [-g|--gen_rest_dump] | [-h|--help]
       -t|--tree  : Subtree to start the suite
       -h|--help   : help & show this output
EO
}

OPTS=`getopt -o hgt: -l help,tree,gen_rest_dump: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then
       echo "Failed parsing options." >&2
       exit 1
fi
eval set -- "$OPTS"

OPTION=" "
#Parse the options
while true
do
    case "$1" in
        -t|--tree)
	   OPTION+=" -t $2"
           shift 2
           ;;
        -h|--help)
           usage
           exit
           ;;
        -g|--gen)
	   OPTION+=" -g"
           shift
           ;;
        --)
               shift;
           break;
           ;;
        *)
           echo "Unknown option"
           exit
           ;;
    esac
done

CDIR=$(dirname $0)
echo "OPTION=$OPTION"
$CDIR/rBreeze_operational.py $OPTION
