# verbose='false'
# aflag=''
# bflag=''
# files=''
# while getopts 'abf:v' flag; do
#   case "${flag}" in
#     a) aflag='true' ;;
#     b) bflag='true' ;;
#     f) files="${OPTARG}" ;;
#     v) verbose='true' ;;
#     *) error "Unexpected option ${flag}" ;;
#   esac
# done

# reset in case getopts has been used previously in the shell
OPTIND=1
while getopts 'abc:' f; do
  case ${f} in
    a | b)
      flag=${f}
      ;;
    c)
      carg=${OPTARG}
      ;;
    \?)
      usage
      exit 1
      ;;
  esac
done
shift "$((OPTIND - 1))"

# this code will accept any of the following as equivalent:
# cmd -acarg file file
# cmd -a -c arg file file
# cmd -carg -a file file
# cmd -a -carg -- file file
