111
111
int option_index = 0;
112
112
static struct option long_options[] =
117
{"verbose", 0, 0, 0},
117
{"verbose", 0, 0, 0},
123
123
c = getopt_long (argc, argv, "abc:d:0123456789",
124
long_options, &option_index);
124
long_options, &option_index);
131
printf ("option %s", long_options[option_index].name);
133
printf (" with arg %s", optarg);
147
if (digit_optind != 0 && digit_optind != this_option_optind)
148
printf ("digits occur in two different argv-elements.\n");
149
digit_optind = this_option_optind;
150
printf ("option %c\n", c);
154
printf ("option a\n");
158
printf ("option b\n");
162
printf ("option c with value `%s'\n", optarg);
166
printf ("option d with value `%s'\n", optarg);
173
printf ("?? getopt returned character code 0%o ??\n", c);
131
printf ("option %s", long_options[option_index].name);
133
printf (" with arg %s", optarg);
147
if (digit_optind != 0 && digit_optind != this_option_optind)
148
printf ("digits occur in two different argv-elements.\n");
149
digit_optind = this_option_optind;
150
printf ("option %c\n", c);
154
printf ("option a\n");
158
printf ("option b\n");
162
printf ("option c with value `%s'\n", optarg);
166
printf ("option d with value `%s'\n", optarg);
173
printf ("?? getopt returned character code 0%o ??\n", c);
177
177
if (optind < argc)
179
179
printf ("non-option ARGV-elements: ");
180
180
while (optind < argc)
181
printf ("%s ", argv[optind++]);
181
printf ("%s ", argv[optind++]);