Lines Matching refs:optind

127    Otherwise, `optind' communicates from one call to the next
131 int optind = 1;
133 /* Formerly, initialization of getopt depended on optind==0, which
186 `--' can cause `getopt' to return -1 with `optind' != ARGC. */
302 The other is elements [last_nonopt,optind), which contains all
318 int top = optind;
388 first_nonopt += (optind - last_nonopt);
389 last_nonopt = optind;
407 first_nonopt = last_nonopt = optind;
474 updating `optind' and `nextchar' so that the next call to `getopt' can
478 Then `optind' is the index in ARGV of the first ARGV-element
531 if (optind == 0 || !__getopt_initialized)
533 if (optind == 0)
534 optind = 1; /* Don't scan ARGV[0], the program name. */
539 /* Test whether ARGV[optind] points to a non-option argument.
544 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
545 || (optind < nonoption_flags_len \
546 && __getopt_nonoption_flags[optind] == '1'))
548 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
557 if (last_nonopt > optind)
558 last_nonopt = optind;
559 if (first_nonopt > optind)
560 first_nonopt = optind;
567 if (first_nonopt != last_nonopt && last_nonopt != optind)
569 else if (last_nonopt != optind)
570 first_nonopt = optind;
575 while (optind < argc && NONOPTION_P)
576 optind++;
577 last_nonopt = optind;
585 if (optind != argc && !strcmp (argv[optind], "--"))
587 optind++;
589 if (first_nonopt != last_nonopt && last_nonopt != optind)
592 first_nonopt = optind;
595 optind = argc;
601 if (optind == argc)
606 optind = first_nonopt;
617 optarg = argv[optind++];
624 nextchar = (argv[optind] + 1
625 + (longopts != NULL && argv[optind][1] == '-'));
644 && (argv[optind][1] == '-'
645 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
687 argv[0], argv[optind]);
689 optind++;
697 optind++;
708 if (argv[optind - 1][1] == '-')
717 argv[0], argv[optind - 1][0], pfound->name);
728 if (optind < argc)
729 optarg = argv[optind++];
735 argv[0], argv[optind - 1]);
756 if (!long_only || argv[optind][1] == '-'
761 if (argv[optind][1] == '-')
768 argv[0], argv[optind][0], nextchar);
771 optind++;
783 /* Increment `optind' when we start to process its last character. */
785 ++optind;
819 optind++;
821 else if (optind == argc)
837 /* We already incremented `optind' once;
839 optarg = argv[optind++];
874 argv[0], argv[optind]);
876 optind++;
901 if (optind < argc)
902 optarg = argv[optind++];
908 argv[0], argv[optind - 1]);
934 optind++;
948 optind++;
950 else if (optind == argc)
966 /* We already incremented `optind' once;
968 optarg = argv[optind++];
1006 int this_option_optind = optind ? optind : 1;
1050 if (optind < argc)
1053 while (optind < argc)
1054 printf ("%s ", argv[optind++]);