Lines Matching full:argv
49 As 'getopt_long' works, it permutes the elements of ARGV so that,
66 each non-option ARGV-element is returned here. */
70 /* Index in ARGV of the next element to be scanned.
80 how much of ARGV has been scanned so far. */
115 indicating ARGV elements that should not be considered arguments. */
137 /* Exchange two adjacent subsequences of ARGV.
144 the new indices of the non-options in ARGV after they are moved. */
147 exchange (char **argv, struct _getopt_data *d)
192 tem = argv[bottom + i];
193 argv[bottom + i] = argv[top - (middle - bottom) + i];
194 argv[top - (middle - bottom) + i] = tem;
209 tem = argv[bottom + i];
210 argv[bottom + i] = argv[middle + i];
211 argv[middle + i] = tem;
229 char **argv _GL_UNUSED, const char *optstring,
232 /* Start processing options with ARGV-element 1 (since ARGV-element 0
234 non-option ARGV-elements is empty. */
261 && argc == __libc_argc && argv == __libc_argv)
293 /* Scan elements of ARGV (whose length is ARGC) for option characters
296 If an element of ARGV starts with '-', and is not exactly "-" or "--",
304 resume the scan with the following option character or ARGV-element.
307 Then 'optind' is the index in ARGV of the first ARGV-element
308 that is not an option. (The ARGV-elements have been permuted
317 so the following text in the same ARGV-element, or the text of the following
318 ARGV-element, is returned in 'optarg'. Two colons mean an option that
319 wants an optional arg; if there is text in the current ARGV-element,
323 handling the non-option ARGV-elements.
329 argument, it follows the option name in the same ARGV-element, separated
330 from the option name by a '=', or else the in next ARGV-element.
335 The elements of ARGV aren't really const, because we permute them.
350 _getopt_internal_r (int argc, char **argv, const char *optstring,
364 d->optind = 1; /* Don't scan ARGV[0], the program name. */
365 optstring = _getopt_initialize (argc, argv, optstring, d,
374 /* Test whether ARGV[optind] points to a non-option argument.
379 # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \
383 # define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
388 /* Advance to the next ARGV-element. */
404 exchange ((char **) argv, d);
416 /* The special ARGV-element '--' means premature end of options.
421 if (d->optind != argc && !strcmp (argv[d->optind], "--"))
427 exchange ((char **) argv, d);
435 /* If we have done all the ARGV-elements, stop the scan
454 d->optarg = argv[d->optind++];
458 /* We have found another option-ARGV-element.
461 d->__nextchar = (argv[d->optind] + 1
462 argv[d->optind][1] == '-'));
465 /* Decode the current option-ARGV-element. */
467 /* Check whether the ARGV-element is a long option.
469 If long_only and the ARGV-element has the form "-f", where f is
475 the ARGV-element is "-fu", do consider that an abbreviation of
481 && (argv[d->optind][1] == '-'
482 || (long_only && (argv[d->optind][2]
483 || !strchr (optstring, argv[d->optind][1])))))
552 argv[0], argv[d->optind]);
581 argv[0], argv[d->optind]);
624 if (argv[d->optind - 1][1] == '-')
630 argv[0], pfound->name);
634 argv[0], pfound->name);
643 argv[0], argv[d->optind - 1][0],
648 argv[0], argv[d->optind - 1][0],
681 d->optarg = argv[d->optind++];
691 argv[0], pfound->name) >= 0)
709 argv[0], pfound->name);
732 if (!long_only || argv[d->optind][1] == '-'
742 if (argv[d->optind][1] == '-')
747 argv[0], d->__nextchar);
750 argv[0], d->__nextchar);
758 argv[0], argv[d->optind][0], d->__nextchar);
761 argv[0], argv[d->optind][0], d->__nextchar);
810 argv[0], c);
812 fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
853 /* If we end this ARGV-element by taking the rest as an arg,
866 argv[0], c) >= 0)
883 argv[0], c);
895 increment it again when taking next ARGV-elt as argument. */
896 d->optarg = argv[d->optind++];
939 argv[0], d->optarg) >= 0)
955 argv[0], d->optarg);
980 argv[0], pfound->name) >= 0)
998 argv[0], pfound->name);
1009 d->optarg = argv[d->optind++];
1019 argv[0], pfound->name) >= 0)
1037 argv[0], pfound->name);
1081 /* If we end this ARGV-element by taking the rest as an arg,
1094 argv[0], c) >= 0)
1111 argv[0], c);
1122 increment it again when taking next ARGV-elt as argument. */
1123 d->optarg = argv[d->optind++];
1132 _getopt_internal (int argc, char **argv, const char *optstring,
1141 result = _getopt_internal_r (argc, argv, optstring, longopts,
1161 getopt (int argc, char *const *argv, const char *optstring)
1163 return _getopt_internal (argc, (char **) argv, optstring,
1171 __posix_getopt (int argc, char *const *argv, const char *optstring)
1173 return _getopt_internal (argc, argv, optstring,
1188 main (int argc, char **argv)
1197 c = getopt (argc, argv, "abc:d:0123456789");
1214 printf ("digits occur in two different argv-elements.\n");
1241 printf ("non-option ARGV-elements: ");
1243 printf ("%s ", argv[optind++]);