4 * Simple test for getopt, set the environment variable GETOPTTEST
5 * to give the argument string to getopt()
12 int main(int argc, char * const *argv)
15 char showchar[] = "\'?\'";
18 parser = getenv("GETOPTTEST");
19 if ( !parser ) parser = "abzf:o:";
22 c = getopt(argc, argv, parser);
24 printf("c = %s, optind = %d (%s), optarg = \"%s\", optopt = \'%c\'\n",
25 (c == EOF) ? "EOF" : showchar,
26 optind, argv[optind], optarg, optopt);