Lines Matching refs:optind
126 Otherwise, `optind' communicates from one call to the next
130 int optind = 1;
132 /* Formerly, initialization of getopt depended on optind==0, which
185 `--' can cause `getopt' to return -1 with `optind' != ARGC. */
305 The other is elements [last_nonopt,optind), which contains all
321 int top = optind;
391 first_nonopt += (optind - last_nonopt);
392 last_nonopt = optind;
410 first_nonopt = last_nonopt = optind;
477 updating `optind' and `nextchar' so that the next call to `getopt' can
481 Then `optind' is the index in ARGV of the first ARGV-element
541 if (optind == 0 || !__getopt_initialized)
543 if (optind == 0)
544 optind = 1; /* Don't scan ARGV[0], the program name. */
549 /* Test whether ARGV[optind] points to a non-option argument.
554 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
555 || (optind < nonoption_flags_len \
556 && __getopt_nonoption_flags[optind] == '1'))
558 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
565 /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
567 if (last_nonopt > optind)
568 last_nonopt = optind;
569 if (first_nonopt > optind)
570 first_nonopt = optind;
577 if (first_nonopt != last_nonopt && last_nonopt != optind)
579 else if (last_nonopt != optind)
580 first_nonopt = optind;
585 while (optind < argc && NONOPTION_P)
586 optind++;
587 last_nonopt = optind;
595 if (optind != argc && !strcmp (argv[optind], "--"))
597 optind++;
599 if (first_nonopt != last_nonopt && last_nonopt != optind)
602 first_nonopt = optind;
605 optind = argc;
611 if (optind == argc)
616 optind = first_nonopt;
627 optarg = argv[optind++];
634 nextchar = (argv[optind] + 1
635 + (longopts != NULL && argv[optind][1] == '-'));
654 && (argv[optind][1] == '-'
655 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
700 argv[0], argv[optind]);
702 optind++;
710 optind++;
721 if (argv[optind - 1][1] == '-')
730 argv[0], argv[optind - 1][0], pfound->name);
741 if (optind < argc)
742 optarg = argv[optind++];
748 argv[0], argv[optind - 1]);
769 if (!long_only || argv[optind][1] == '-'
774 if (argv[optind][1] == '-')
781 argv[0], argv[optind][0], nextchar);
784 optind++;
796 /* Increment `optind' when we start to process its last character. */
798 ++optind;
832 optind++;
834 else if (optind == argc)
850 /* We already incremented `optind' once;
852 optarg = argv[optind++];
887 argv[0], argv[optind]);
889 optind++;
914 if (optind < argc)
915 optarg = argv[optind++];
921 argv[0], argv[optind - 1]);
947 optind++;
961 optind++;
963 else if (optind == argc)
979 /* We already incremented `optind' once;
981 optarg = argv[optind++];
1019 int this_option_optind = optind ? optind : 1;
1063 if (optind < argc)
1066 while (optind < argc)
1067 printf ("%s ", argv[optind++]);