use getopts instead of getopt due to 1) simplicity 2) bash built-in.