Changed cli parser from getopt to optparse.