getopt.h:
#define no_argument 0
#define required_argument 1
#define optional_argument 2
struct option {
/* name of long option */
const char *name;
/*
* one of no_argument, required_argument, and optional_argument:
* whether option takes an argument
*/
int has_arg;
/* if not NULL, set *flag to val when option found */
int *flag;
/* if flag not NULL, value to set *flag to; else return value */
int val;
};
具体参考:man getopt_long
getopt, getopt_long, getopt_long_only, optarg, optind, opterr, optopt - Parse command-line options
1044

被折叠的 条评论
为什么被折叠?



