Home | History | Annotate | Download | only in getopt

Lines Matching defs:optind

125    Otherwise, `optind' communicates from one call to the next
129 int optind = 1;
131 /* Formerly, initialization of getopt depended on optind==0, which
184 `--' can cause `getopt' to return -1 with `optind' != ARGC. */
296 The other is elements [last_nonopt,optind), which contains all
312 int top = optind;
382 first_nonopt += (optind - last_nonopt);
383 last_nonopt = optind;
401 first_nonopt = last_nonopt = optind;
468 updating `optind' and `nextchar' so that the next call to `getopt' can
472 Then `optind' is the index in ARGV of the first ARGV-element
532 if (optind == 0 || !__getopt_initialized)
534 if (optind == 0)
535 optind = 1; /* Don't scan ARGV[0], the program name. */
540 /* Test whether ARGV[optind] points to a non-option argument.
545 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
546 || (optind < nonoption_flags_len \
547 && __getopt_nonoption_flags[optind] == '1'))
549 # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
556 /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
558 if (last_nonopt > optind)
559 last_nonopt = optind;
560 if (first_nonopt > optind)
561 first_nonopt = optind;
568 if (first_nonopt != last_nonopt && last_nonopt != optind)
570 else if (last_nonopt != optind)
571 first_nonopt = optind;
576 while (optind < argc && NONOPTION_P)
577 optind++;
578 last_nonopt = optind;
586 if (optind != argc && !strcmp (argv[optind], "--"))
588 optind++;
590 if (first_nonopt != last_nonopt && last_nonopt != optind)
593 first_nonopt = optind;
596 optind = argc;
602 if (optind == argc)
607 optind = first_nonopt;
618 optarg = argv[optind++];
625 nextchar = (argv[optind] + 1
626 + (longopts != NULL && argv[optind][1] == '-'));
645 && (argv[optind][1] == '-'
646 || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
691 argv[0], argv[optind]);
693 optind++;
701 optind++;
712 if (argv[optind - 1][1] == '-')
721 argv[0], argv[optind - 1][0], pfound->name);
732 if (optind < argc)
733 optarg = argv[optind++];
739 argv[0], argv[optind - 1]);
760 if (!long_only || argv[optind][1] == '-'
765 if (argv[optind][1] == '-')
772 argv[0], argv[optind][0], nextchar);
775 optind++;
787 /* Increment `optind' when we start to process its last character. */
789 ++optind;
823 optind++;
825 else if (optind == argc)
841 /* We already incremented `optind' once;
843 optarg = argv[optind++];
878 argv[0], argv[optind]);
880 optind++;
905 if (optind < argc)
906 optarg = argv[optind++];
912 argv[0], argv[optind - 1]);
938 optind++;
952 optind++;
954 else if (optind == argc)
970 /* We already incremented `optind' once;
972 optarg = argv[optind++];
1010 int this_option_optind = optind ? optind : 1;
1054 if (optind < argc)
1057 while (optind < argc)
1058 printf ("%s ", argv[optind++]);