Lines Matching refs:optind

132    Otherwise, `optind' communicates from one call to the next
136 int optind = 1;
138 /* Formerly, initialization of getopt depended on optind==0, which
191 `--' can cause `getopt' to return -1 with `optind' != ARGC. */
298 The other is elements [last_nonopt,optind), which contains all
314 int top = optind;
384 first_nonopt += (optind - last_nonopt);
385 last_nonopt = optind;
403 first_nonopt = last_nonopt = optind;
470 updating `optind' and `nextchar' so that the next call to `getopt' can
474 Then `optind' is the index in ARGV of the first ARGV-element
534 if (optind == 0 || !__getopt_initialized)
536 if (optind == 0)
537 optind = 1; /* Don't scan ARGV[0], the program name. */
542 /* Test whether ARGV[optind] points to a non-option argument.
547 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
548 || (optind < nonoption_flags_len \
549 && __getopt_nonoption_flags[optind] == '1'))
551 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
560 if (last_nonopt > optind)
561 last_nonopt = optind;
562 if (first_nonopt > optind)
563 first_nonopt = optind;
570 if (first_nonopt != last_nonopt && last_nonopt != optind)
572 else if (last_nonopt != optind)
573 first_nonopt = optind;
578 while (optind < argc && NONOPTION_P)
579 optind++;
580 last_nonopt = optind;
588 if (optind != argc && !strcmp (argv[optind], "--"))
590 optind++;
592 if (first_nonopt != last_nonopt && last_nonopt != optind)
595 first_nonopt = optind;
598 optind = argc;
604 if (optind == argc)
609 optind = first_nonopt;
620 optarg = argv[optind++];
627 nextchar = (argv[optind] + 1
628 + (longopts != NULL && argv[optind][1] == '-'));
647 && (argv[optind][1] == '-'
648 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
697 argv[0], argv[optind]) >= 0)
709 argv[0], argv[optind]);
713 optind++;
721 optind++;
737 if (argv[optind - 1][1] == '-')
756 argv[0], argv[optind - 1][0],
761 argv[0], argv[optind - 1][0], pfound->name);
786 if (optind < argc)
787 optarg = argv[optind++];
797 argv[0], argv[optind - 1]) >= 0)
809 argv[0], argv[optind - 1]);
832 if (!long_only || argv[optind][1] == '-'
842 if (argv[optind][1] == '-')
858 argv[0], argv[optind][0], nextchar);
861 argv[0], argv[optind][0], nextchar);
878 optind++;
890 /* Increment `optind' when we start to process its last character. */
892 ++optind;
955 optind++;
957 else if (optind == argc)
989 /* We already incremented `optind' once;
991 optarg = argv[optind++];
1030 argv[0], argv[optind]) >= 0)
1041 argv[0], argv[optind]);
1045 optind++;
1088 if (optind < argc)
1089 optarg = argv[optind++];
1099 argv[0], argv[optind - 1]) >= 0)
1111 argv[0], argv[optind - 1]);
1139 optind++;
1153 optind++;
1155 else if (optind == argc)
1187 /* We already incremented `optind' once;
1189 optarg = argv[optind++];
1227 int this_option_optind = optind ? optind : 1;
1271 if (optind < argc)
1274 while (optind < argc)
1275 printf ("%s ", argv[optind++]);