parsing bash command line arguments

#!/bin/bash
ARGC=$#
ARGV0=$0
i=1
flush=false
block=false
allow_prn=false
while (( $i <= $ARGC ))
do
  arg=${!i}  
  if [[ $arg =~ "^-f$" ]]
  then
    flush=true
  elif [[ $arg =~ "^-b$" ]] 
  then    
    block=true
  elif [[ $arg =~ "^--allow_prn$" ]] 
  then    
    allow_prn=true
  else
    echo "Argument not recognized: $arg"
  fi
  i=$((i+1))
done