Lines Matching refs:optind

124    Otherwise, `optind' communicates from one call to the next
128 int optind = 1;
130 /* Formerly, initialization of getopt depended on optind==0, which
183 `--' can cause `getopt' to return -1 with `optind' != ARGC. */
303 The other is elements [last_nonopt,optind), which contains all
319 int top = optind;
389 first_nonopt += (optind - last_nonopt);
390 last_nonopt = optind;
408 first_nonopt = last_nonopt = optind;
475 updating `optind' and `nextchar' so that the next call to `getopt' can
479 Then `optind' is the index in ARGV of the first ARGV-element
539 if (optind == 0 || !__getopt_initialized)
541 if (optind == 0)
542 optind = 1; /* Don't scan ARGV[0], the program name. */
547 /* Test whether ARGV[optind] points to a non-option argument.
552 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
553 || (optind < nonoption_flags_len \
554 && __getopt_nonoption_flags[optind] == '1'))
556 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
565 if (last_nonopt > optind)
566 last_nonopt = optind;
567 if (first_nonopt > optind)
568 first_nonopt = optind;
575 if (first_nonopt != last_nonopt && last_nonopt != optind)
577 else if (last_nonopt != optind)
578 first_nonopt = optind;
583 while (optind < argc && NONOPTION_P)
584 optind++;
585 last_nonopt = optind;
593 if (optind != argc && !strcmp (argv[optind], "--"))
595 optind++;
597 if (first_nonopt != last_nonopt && last_nonopt != optind)
600 first_nonopt = optind;
603 optind = argc;
609 if (optind == argc)
614 optind = first_nonopt;
625 optarg = argv[optind++];
632 nextchar = (argv[optind] + 1
633 + (longopts != NULL && argv[optind][1] == '-'));
652 && (argv[optind][1] == '-'
653 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
698 argv[0], argv[optind]);
700 optind++;
708 optind++;
719 if (argv[optind - 1][1] == '-')
728 argv[0], argv[optind - 1][0], pfound->name);
739 if (optind < argc)
740 optarg = argv[optind++];
746 argv[0], argv[optind - 1]);
767 if (!long_only || argv[optind][1] == '-'
772 if (argv[optind][1] == '-')
779 argv[0], argv[optind][0], nextchar);
782 optind++;
794 /* Increment `optind' when we start to process its last character. */
796 ++optind;
830 optind++;
832 else if (optind == argc)
848 /* We already incremented `optind' once;
850 optarg = argv[optind++];
885 argv[0], argv[optind]);
887 optind++;
912 if (optind < argc)
913 optarg = argv[optind++];
919 argv[0], argv[optind - 1]);
945 optind++;
959 optind++;
961 else if (optind == argc)
977 /* We already incremented `optind' once;
979 optarg = argv[optind++];
1017 int this_option_optind = optind ? optind : 1;
1061 if (optind < argc)
1064 while (optind < argc)
1065 printf ("%s ", argv[optind++]);