Lines Matching defs: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. */
300 The other is elements [last_nonopt,optind), which contains all
316 int top = optind;
386 first_nonopt += (optind - last_nonopt);
387 last_nonopt = optind;
405 first_nonopt = last_nonopt = optind;
472 updating `optind' and `nextchar' so that the next call to `getopt' can
476 Then `optind' is the index in ARGV of the first ARGV-element
529 if (optind == 0 || !__getopt_initialized)
531 if (optind == 0)
532 optind = 1; /* Don't scan ARGV[0], the program name. */
537 /* Test whether ARGV[optind] points to a non-option argument.
542 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
543 || (optind < nonoption_flags_len \
544 && __getopt_nonoption_flags[optind] == '1'))
546 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
553 /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
555 if (last_nonopt > optind)
556 last_nonopt = optind;
557 if (first_nonopt > optind)
558 first_nonopt = optind;
565 if (first_nonopt != last_nonopt && last_nonopt != optind)
567 else if (last_nonopt != optind)
568 first_nonopt = optind;
573 while (optind < argc && NONOPTION_P)
574 optind++;
575 last_nonopt = optind;
583 if (optind != argc && !strcmp (argv[optind], "--"))
585 optind++;
587 if (first_nonopt != last_nonopt && last_nonopt != optind)
590 first_nonopt = optind;
593 optind = argc;
599 if (optind == argc)
604 optind = first_nonopt;
615 optarg = argv[optind++];
622 nextchar = (argv[optind] + 1
623 + (longopts != NULL && argv[optind][1] == '-'));
642 && (argv[optind][1] == '-'
643 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
685 argv[0], argv[optind]);
687 optind++;
695 optind++;
706 if (argv[optind - 1][1] == '-')
715 argv[0], argv[optind - 1][0], pfound->name);
725 if (optind < argc)
726 optarg = argv[optind++];
732 argv[0], argv[optind - 1]);
753 if (!long_only || argv[optind][1] == '-'
758 if (argv[optind][1] == '-')
765 argv[0], argv[optind][0], nextchar);
768 optind++;
780 /* Increment `optind' when we start to process its last character. */
782 ++optind;
816 optind++;
818 else if (optind == argc)
834 /* We already incremented `optind' once;
836 optarg = argv[optind++];
871 argv[0], argv[optind]);
873 optind++;
898 if (optind < argc)
899 optarg = argv[optind++];
905 argv[0], argv[optind - 1]);
931 optind++;
945 optind++;
947 else if (optind == argc)
963 /* We already incremented `optind' once;
965 optarg = argv[optind++];
1003 int this_option_optind = optind ? optind : 1;
1047 if (optind < argc)
1050 while (optind < argc)
1051 printf ("%s ", argv[optind++]);