can getopts be used to override user input in a script

I have a script which takes user input as options provided

PS3="Select option to do deploy : "

select OPTION in "eardeploy" "hotdeploy"
do
case $OPTION in
"eardeploy" )
eardeploy.sh
break;;
"hotdeploy" )
hotdeploy.sh
break;;
esac
done

Now to provide these userinputs through command line args I used getopts in my script

while getopts "o:h" options; do
case $options in
o ) OPTION=$OPTARG;;
h|\?|* ) echo -e $usage
exit 1;;
esac
done

Is it possible to make my script work in two scenarios simultaneously

  1. work with the user inputs given as options
  2. work when user inputs are given as command line args so that it wont show the above options for user input.

Please help.

How about specifying two parameters to start the script with ...

sh script -s[cenario]1
sh script -s[cenario]2

... and wrapping up the relevant code in a case-select statement:

while case $PARAM in
-s1) # 1st scenario
-s2) # 2nd scenario
esac