Refactor:use getopt_long