add getopts to parse the arguments.