title: Bash getopts dropping last argument
body: <p>So, I'm trying my hand at using bash's built-in getopts to handle argument processing except I'm getting a strange result. Here's my test script;</p>
  
  <pre><code>#!/bin/sh
  
  HOST=
  OWNER=
  GROUP=
  
  while getopts "h:o:g" OPTION;
    do
      case $OPTION in
      h)
        HOST=$OPTARG
        ;;
      o)
        OWNER=$OPTARG
        ;;
      g)
        GROUP=$OPTARG
        ;;
    esac
  done
  
  echo "$HOST - $OWNER:$GROUP"
  </code></pre>
  
  <p>Yet, when I run the script using this;</p>
  
  <pre><code>./test.sh -h test.host.com -o skittles -g whatever
  </code></pre>
  
  <p>My last arg never gets pulled in or is getting dropped. My result from the echo is;</p>
  
  <pre><code>test.host.com - skittles:
                           ^ where's my group value? O.o
  </code></pre>
  
  <p>Does anyone know what would be causing this?</p>
  
  <p>Thanks.</p>