1 opterr = 0; /* don't want writing to stderr */
2 while ( (i = getopt(argc, argv, "hp:c:e:")) != -1) {
7 case 'h': /* help option */
8 printf("Wrong -h option use\n");
12 case 'c': /* take wait time for children */
13 wait_child = strtol(optarg, NULL, 10); /* convert input */
15 case 'p': /* take wait time for children */
16 wait_parent = strtol(optarg, NULL, 10); /* convert input */
18 case 'e': /* take wait before parent exit */
19 wait_end = strtol(optarg, NULL, 10); /* convert input */
21 case '?': /* unrecognized options */
22 printf("Unrecognized options -%c\n",optopt);
24 default: /* should not reached */
28 debug("Optind %d, argc %d\n",optind,argc);