文件
#include <getopt.h>
函数原型
int getopt_long(int argc, char * const argv[],
const char *optstring,
const struct option *longopts, int *longindex);
函数说明
getopt被用来解析命令行选项参数。
getopt_long支持长选项的命令行解析,使用man getopt_long,得到其声明如下:
int getopt_long(int argc, char * const argv[],const char *optstring, const struct option *longopts,int *longindex);
函数中的argc和argv通常直接从main()的两个