Looking to shorten method of parsing arguments in BASH
Use the ${variable?error message} syntax to error on empty arguments.  Use shift to remove parsed arguments from the positional parameters, so that the next unseen argument is always $1.  If there are any arguments left at the end, there were too many.

When a message isn't enough, you can use trap … EXIT to call a function on error.  Remember to remove the trap after parsing and at the very start of your handler function.

This version isn't any shorter than yours but it's more generic.  You can add parameters or rearrange their order without altering the numbers in the existing logic.  The error-handling is in one place instead of two.

show_help() { 
 trap - EXIT # omitting this can lead to an infinite loop
 exec $0 -h
 exit
}

trap show_help EXIT
error_usage="Usage: $0 input-file [-o output-file]"
input=${1?$error_usage} &amp;&amp; shift
[[ $1 = -o ]] &amp;&amp; output=${2?$error_usage} &amp;&amp; shift 2
[[ -n $1 ]] &amp;&amp; echo $error_usage &amp;&amp; exit 0
trap - EXIT

echo "input=$input output=$output"


Rather than invoking ourselves to display help, I'd just put the help logic in the show_help function.