Change to use getopt() for options passing.