How can i pass 2 command line arguments with a range between them

Hi,

I am writting a script. i am not sure what i am trying to do is possible or not. thats why asking the best of the best.

the script i want to write will recieve as input parameters 2 different options.

as in

MODE 1 
-- start_date / end_date (2 dates has 2 go at a time
 
MODE 2
-- start_model_no. / end_model_no.

the script will be generating the records within this interval of dates in mode1 (taking into account the start date) or within the range of model_no. in Mode 2.

any ideas how is this suppose to be done. i can use getopts() for putting 2 different modes but how will i pass the range??

(am i thinking in correct lines or is there any other way to do this)

see below :-

 
while getopts D:M: PARAMETERS
do
        case ${PARAMETERS} in
                D)      DATE=$OPTARG;;
                M)      MODEL_NUMBER=$OPTARG;;
                *)      A_ERR=1
        esac

I would pass the range as parameters.
after the getopts you put this :

shift $((OPTIND-1))
START=$1
END=$2

Another way could be to autodetect if the parameters are dates or modes. Anyway, it would be a good thing to check if dates are valid or not like

Pseudo-code
if valid dates
then process as dates
elif valid modes
then process as modes
else invalid parameters
fi

thanks a lot frans.