41 static int getopt(
int argc,
char *argv[],
char *opts)
51 else if (!strcmp(argv[
optind],
"--")) {
56 if (c ==
':' || (cp = strchr(opts, c)) ==
NULL) {
57 fprintf(stderr,
": illegal option -- %c\n", c);
58 if (argv[optind][++sp] ==
'\0') {
65 if (argv[optind][sp+1] !=
'\0')
66 optarg = &argv[optind++][sp+1];
67 else if(++optind >= argc) {
68 fprintf(stderr,
": option requires an argument -- %c\n", c);
75 if (argv[optind][++sp] ==
'\0') {
static int getopt(int argc, char *argv[], char *opts)