title: getopts printing help when no cmd. line argument was matched
body: <p>I'm trying to use getopts in bash to parse command line arguments, but I couldn't figure out how to implement "default" action, if no argument was matched (or no cmdline argument given). </p>
  
  <p>This is silghtly simplified version of what I've tried so far:</p>
  
  <pre><code>while getopts v:t:r:s:c: name;
  do
          case $name in
          v) VALIDATE=1;;
          t) TEST=1;;
          r) REPORT=1;;
          s) SYNC=1;;
          c) CLEAR=1;;
          *) print_help; exit 2;;
          \?) print_help; exit 2;;
          esac
  done
  </code></pre>
  
  <p>Is there any (simple) way to make it call print_help; exit 2; on non matching input?</p>