Lines Matching defs:optind
121 Otherwise, `optind' communicates from one call to the next
125 int optind = 1;
127 /* Formerly, initialization of getopt depended on optind==0, which
180 `--' can cause `getopt' to return -1 with `optind' != ARGC. */
291 The other is elements [last_nonopt,optind), which contains all
306 int top = optind;
376 first_nonopt += (optind - last_nonopt);
377 last_nonopt = optind;
392 first_nonopt = last_nonopt = optind;
459 updating `optind' and `nextchar' so that the next call to `getopt' can
463 Then `optind' is the index in ARGV of the first ARGV-element
511 if (optind == 0 || !__getopt_initialized)
513 if (optind == 0)
514 optind = 1; /* Don't scan ARGV[0], the program name. */
519 /* Test whether ARGV[optind] points to a non-option argument.
524 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
525 || (optind < nonoption_flags_len \
526 && __getopt_nonoption_flags[optind] == '1'))
528 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
535 /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
537 if (last_nonopt > optind)
538 last_nonopt = optind;
539 if (first_nonopt > optind)
540 first_nonopt = optind;
547 if (first_nonopt != last_nonopt && last_nonopt != optind)
549 else if (last_nonopt != optind)
550 first_nonopt = optind;
555 while (optind < argc && NONOPTION_P)
556 optind++;
557 last_nonopt = optind;
565 if (optind != argc && !strcmp (argv[optind], "--"))
567 optind++;
569 if (first_nonopt != last_nonopt && last_nonopt != optind)
572 first_nonopt = optind;
575 optind = argc;
581 if (optind == argc)
586 optind = first_nonopt;
597 optarg = argv[optind++];
604 nextchar = (argv[optind] + 1
605 + (longopts != NULL && argv[optind][1] == '-'));
624 && (argv[optind][1] == '-'
625 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
667 argv[0], argv[optind]);
669 optind++;
677 optind++;
687 if (argv[optind - 1][1] == '-')
696 argv[0], argv[optind - 1][0], pfound->name);
706 if (optind < argc)
707 optarg = argv[optind++];
713 argv[0], argv[optind - 1]);
734 if (!long_only || argv[optind][1] == '-'
739 if (argv[optind][1] == '-')
746 argv[0], argv[optind][0], nextchar);
749 optind++;
761 /* Increment `optind' when we start to process its last character. */
763 ++optind;
797 optind++;
799 else if (optind == argc)
815 /* We already incremented `optind' once;
817 optarg = argv[optind++];
852 argv[0], argv[optind]);
854 optind++;
879 if (optind < argc)
880 optarg = argv[optind++];
886 argv[0], argv[optind - 1]);
912 optind++;
926 optind++;
928 else if (optind == argc)
944 /* We already incremented `optind' once;
946 optarg = argv[optind++];
979 int this_option_optind = optind ? optind : 1;
1023 if (optind < argc)
1026 while (optind < argc)
1027 printf ("%s ", argv[optind++]);