This example shows how to read options and positional arguments from a bash script (same principle can be applied for other shells).
# some global var we want to overwrite with options
force=false
help=false
log=info
ARGS=() ### this array holds any positional arguments, i.e., arguments not started with dash
while [ $# -gt 0 ]; do