use getopts to parse options