I don't remember where I found this but I like to start all my scripts this way. I gives you a good starting point. I added the --prefix= but you can add as many options as you like this way.
Code:
!/bin/bash
function usage ()
{
echo "Usage:"
echo " script [--test|--help|--version] [--prefix=<prefix>]"
}
while test "$1" != "" ; do
case $1 in
--prefix=*)
prefix=`echo $1|sed 's/^.*\=//'`
echo "Prefix set to $prefix"
;;
--test|-t)
echo "you used the --test option"
;;
--help|-h)
usage
exit 0
;;
--version|-v)
echo "script version 0.0.1"
exit 0
;;
-*)
echo "Error: no such option $1"
usage
exit 1
;;
esac
shift
done