What you are missing is a function definition of usage:
function usage {
cat <<-USAGE
Now you can define your usage here
take as many lines as you want. When
you finish, just put "USAGE" on a line
by itself.
USAGE
}
Put this BEFORE the call of usage
. Remember that the line with USAGE
must be preceded only by tabs.