Upon execution we loop through all command-line arguments, those that match can then be assigned to variables or what have you in the case block.

#!/bin/bash

while [[ $# > 1 ]]
do
key="$1"

case $key in
    -e|--extension)
    EXTENSION="$2"
    shift # past argument
    ;;
    -s|--searchpath)
    SEARCHPATH="$2"
    shift # past argument
    ;;
    -l|--lib)
    LIBPATH="$2"
    shift # past argument
    ;;
    --default)
    DEFAULT=YES
    ;;
    *)
            # unknown option, simply ignore?
    ;;
esac
shift # past argument or value
done

# ...rest of code