use getopt to deal with command line