GetOpt

How to handle option in bash (option with : take argument (stored in OPTARG)):

while getopts hf: opt ; do
    case "$opt" in
      f)
        FDEV="$OPTARG"
        ;;
      [?]|h)
        usage
        ;;
    esac
  done
  shift $((OPTIND-1))