Use getopt to parse cmd arguments