title: parsing parameters in shell script
body: <p>I have a myscript.sh which starts like this:</p>
  
  <pre><code>#!/usr/bin/env bash
  set -e
  
  usage(){
    echo "Show Usage ... Blah blah"
    exit 1
  }
  
  if [ $# = 0 ]; then
    usage;
  fi
  
  while true; do
    case "$1" in
      -l | --build-lib ) BUILD_LIB=true; 
      --other-option ) OTHER_OPTION=$2; shift; shift;;
      -h | --help ) usage; shift;;
      * ) break ;;
    esac
  done
  
  # I do my thing here ....
  echo "Do my thing"
  </code></pre>
  
  <p>I am not sure if this is the best way to parse the parameters but so far I have a problem. I am not correctly breaking/failing when the user passes wrong or unknown parameters. How can I address this correctly?</p>
  
  <p>for example I want to avoid calls like:</p>
  
  <pre><code>$ ./myscript.sh unknownParameter
  </code></pre>