Lines Matching refs:optind
38 /* The variable optind [...] shall be initialized to 1 by the system. */
39 int optind = 1;
61 if (optind >= argc)
64 /* If, when getopt() is called argv[optind] is a null pointer, getopt()
65 shall return -1 without changing optind. */
66 if (argv[optind] == NULL)
69 /* If, when getopt() is called *argv[optind] is not the character '-',
70 getopt() shall return -1 without changing optind. */
71 if (*argv[optind] != '-')
74 /* If, when getopt() is called argv[optind] points to the string "-",
75 getopt() shall return -1 without changing optind. */
76 if (strcmp(argv[optind], "-") == 0)
79 /* If, when getopt() is called argv[optind] points to the string "--",
80 getopt() shall return -1 after incrementing optind. */
81 if (strcmp(argv[optind], "--") == 0) {
82 ++optind;
87 optcursor = argv[optind] + 1;
113 of argv, and optind shall be incremented by 2. If the resulting
114 value of optind is greater than argc, this indicates a missing
118 option character in that element of argv, and optind shall be
121 if (++optind < argc) {
122 optarg = argv[optind];
145 ++optind;
170 if (optind >= argc)
173 if (strlen(argv[optind]) < 3 || strncmp(argv[optind], "--", 2) != 0)
177 current_argument = argv[optind] + 2;
202 optarg = strchr(argv[optind], '=');
209 if (optarg == NULL && ++optind < argc) {
210 optarg = argv[optind];
216 } else if (strchr(argv[optind], '=')) {
228 ++optind;