Use getopt() for parsing command line