Lines Matching refs:optind
135 Otherwise, `optind' communicates from one call to the next
139 int optind = 1;
141 /* Formerly, initialization of getopt depended on optind==0, which
194 `--' can cause `getopt' to return -1 with `optind' != ARGC. */
301 The other is elements [last_nonopt,optind), which contains all
317 int top = optind;
387 first_nonopt += (optind - last_nonopt);
388 last_nonopt = optind;
406 first_nonopt = last_nonopt = optind;
473 updating `optind' and `nextchar' so that the next call to `getopt' can
477 Then `optind' is the index in ARGV of the first ARGV-element
537 if (optind == 0 || !__getopt_initialized)
539 if (optind == 0)
540 optind = 1; /* Don't scan ARGV[0], the program name. */
545 /* Test whether ARGV[optind] points to a non-option argument.
550 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
551 || (optind < nonoption_flags_len \
552 && __getopt_nonoption_flags[optind] == '1'))
554 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
563 if (last_nonopt > optind)
564 last_nonopt = optind;
565 if (first_nonopt > optind)
566 first_nonopt = optind;
573 if (first_nonopt != last_nonopt && last_nonopt != optind)
575 else if (last_nonopt != optind)
576 first_nonopt = optind;
581 while (optind < argc && NONOPTION_P)
582 optind++;
583 last_nonopt = optind;
591 if (optind != argc && !strcmp (argv[optind], "--"))
593 optind++;
595 if (first_nonopt != last_nonopt && last_nonopt != optind)
598 first_nonopt = optind;
601 optind = argc;
607 if (optind == argc)
612 optind = first_nonopt;
623 optarg = argv[optind++];
630 nextchar = (argv[optind] + 1
631 + (longopts != NULL && argv[optind][1] == '-'));
650 && (argv[optind][1] == '-'
651 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
700 argv[0], argv[optind]) >= 0)
712 argv[0], argv[optind]);
716 optind++;
724 optind++;
740 if (argv[optind - 1][1] == '-')
759 argv[0], argv[optind - 1][0],
764 argv[0], argv[optind - 1][0], pfound->name);
789 if (optind < argc)
790 optarg = argv[optind++];
800 argv[0], argv[optind - 1]) >= 0)
812 argv[0], argv[optind - 1]);
835 if (!long_only || argv[optind][1] == '-'
845 if (argv[optind][1] == '-')
861 argv[0], argv[optind][0], nextchar);
864 argv[0], argv[optind][0], nextchar);
881 optind++;
893 /* Increment `optind' when we start to process its last character. */
895 ++optind;
958 optind++;
960 else if (optind == argc)
992 /* We already incremented `optind' once;
994 optarg = argv[optind++];
1033 argv[0], argv[optind]) >= 0)
1044 argv[0], argv[optind]);
1048 optind++;
1091 if (optind < argc)
1092 optarg = argv[optind++];
1102 argv[0], argv[optind - 1]) >= 0)
1114 argv[0], argv[optind - 1]);
1142 optind++;
1156 optind++;
1158 else if (optind == argc)
1190 /* We already incremented `optind' once;
1192 optarg = argv[optind++];
1230 int this_option_optind = optind ? optind : 1;
1274 if (optind < argc)
1277 while (optind < argc)
1278 printf ("%s ", argv[optind++]);