2 File autogenerated by gengetopt version 2.22.5
3 generated with the following command:
4 gengetopt -i kinfold.ggo --default-optional --include-getopt
6 The developers of gengetopt consider the fixed text that goes in all
7 gengetopt output files to be in the public domain:
8 we make no copyright claims on it.
11 /* If we use autoconf. */
21 #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
27 const char *gengetopt_args_info_purpose = "Kinetic Folding Program for Nucleic Acids";
29 const char *gengetopt_args_info_usage = "Usage: Kinfold [OPTIONS]...";
31 const char *gengetopt_args_info_description = "";
33 const char *gengetopt_args_info_full_help[] = {
34 " -h, --help Print help and exit",
35 " --full-help Print help, including hidden options, and exit",
36 " -V, --version Print version and exit",
38 " -d, --dangle=INT <0|1|2> set dangling end model to (none|normal|double) \n (possible values=\"0\", \"1\", \"2\" default=`2')",
39 " -T, --Temp=FLOAT simulation temperature (default=`37')",
40 " -P, --Par=filename read energy-parameter-file",
41 " --logML use logarithmic multiloop energies instead of linear \n (default=on)",
43 " --noShift turn off shift-moves (default=off)",
44 " --noLP forbid structures with isolated base-pairs \n (default=off)",
46 " --seed=STRING set random number seed specify 3 integers as \n int=int=int (default=`clock')",
47 " --time=FLOAT set maxtime of simulation (default=`500')",
48 " --num=INT set number of trajectories (default=`1')",
49 " --start read start structure from stdin (otherwise use open \n chain) (default=off)",
50 " --stop read stop structure(s) from stdin (optherwise use MFE) \n (default=off)",
51 " --met use Metropolis rule for rates (not Kawasaki rule) \n (default=off)",
52 " --fpt compute first passage time (stop when a stop-structure \n is reached) (default=on)",
53 " --grow=FLOAT grow chain every <float> time units (default=`0')",
54 " --glen=INT initial size of growing chain (default=`15')",
55 " --phi=DOUBLE set phi value",
56 " --pbounds=STRING specify 3 floats for phi_min, phi_inc, phi_max in the \n form <d1=d2=d3>",
58 " --log=filename set basename of log-file (default=`kinout')",
59 " -q, --silent no output to stdout (default=off)",
60 " -v, --verbose more information to stdout (default=off)",
61 " --lmin output only local minima to stdout (default=off)",
62 " --cut=FLOAT output structures with E <= <float> to stdout \n (default=`20')",
63 "1st line sequence2nd line start structure (if option --start is used)following \nlines stop structures",
70 gengetopt_args_info_help[0] = gengetopt_args_info_full_help[0];
71 gengetopt_args_info_help[1] = gengetopt_args_info_full_help[1];
72 gengetopt_args_info_help[2] = gengetopt_args_info_full_help[2];
73 gengetopt_args_info_help[3] = gengetopt_args_info_full_help[3];
74 gengetopt_args_info_help[4] = gengetopt_args_info_full_help[4];
75 gengetopt_args_info_help[5] = gengetopt_args_info_full_help[5];
76 gengetopt_args_info_help[6] = gengetopt_args_info_full_help[6];
77 gengetopt_args_info_help[7] = gengetopt_args_info_full_help[7];
78 gengetopt_args_info_help[8] = gengetopt_args_info_full_help[8];
79 gengetopt_args_info_help[9] = gengetopt_args_info_full_help[9];
80 gengetopt_args_info_help[10] = gengetopt_args_info_full_help[10];
81 gengetopt_args_info_help[11] = gengetopt_args_info_full_help[11];
82 gengetopt_args_info_help[12] = gengetopt_args_info_full_help[12];
83 gengetopt_args_info_help[13] = gengetopt_args_info_full_help[13];
84 gengetopt_args_info_help[14] = gengetopt_args_info_full_help[14];
85 gengetopt_args_info_help[15] = gengetopt_args_info_full_help[15];
86 gengetopt_args_info_help[16] = gengetopt_args_info_full_help[16];
87 gengetopt_args_info_help[17] = gengetopt_args_info_full_help[17];
88 gengetopt_args_info_help[18] = gengetopt_args_info_full_help[18];
89 gengetopt_args_info_help[19] = gengetopt_args_info_full_help[19];
90 gengetopt_args_info_help[20] = gengetopt_args_info_full_help[20];
91 gengetopt_args_info_help[21] = gengetopt_args_info_full_help[23];
92 gengetopt_args_info_help[22] = gengetopt_args_info_full_help[24];
93 gengetopt_args_info_help[23] = gengetopt_args_info_full_help[25];
94 gengetopt_args_info_help[24] = gengetopt_args_info_full_help[26];
95 gengetopt_args_info_help[25] = gengetopt_args_info_full_help[27];
96 gengetopt_args_info_help[26] = gengetopt_args_info_full_help[28];
97 gengetopt_args_info_help[27] = gengetopt_args_info_full_help[29];
98 gengetopt_args_info_help[28] = 0;
102 const char *gengetopt_args_info_help[29];
110 } cmdline_parser_arg_type;
113 void clear_given (struct gengetopt_args_info *args_info);
115 void clear_args (struct gengetopt_args_info *args_info);
118 cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
119 struct cmdline_parser_params *params, const char *additional_error);
122 const char *cmdline_parser_dangle_values[] = {"0", "1", "2", 0}; /*< Possible values for dangle. */
125 gengetopt_strdup (const char *s);
128 void clear_given (struct gengetopt_args_info *args_info)
130 args_info->help_given = 0 ;
131 args_info->full_help_given = 0 ;
132 args_info->version_given = 0 ;
133 args_info->dangle_given = 0 ;
134 args_info->Temp_given = 0 ;
135 args_info->Par_given = 0 ;
136 args_info->logML_given = 0 ;
137 args_info->noShift_given = 0 ;
138 args_info->noLP_given = 0 ;
139 args_info->seed_given = 0 ;
140 args_info->time_given = 0 ;
141 args_info->num_given = 0 ;
142 args_info->start_given = 0 ;
143 args_info->stop_given = 0 ;
144 args_info->met_given = 0 ;
145 args_info->fpt_given = 0 ;
146 args_info->grow_given = 0 ;
147 args_info->glen_given = 0 ;
148 args_info->phi_given = 0 ;
149 args_info->pbounds_given = 0 ;
150 args_info->log_given = 0 ;
151 args_info->silent_given = 0 ;
152 args_info->verbose_given = 0 ;
153 args_info->lmin_given = 0 ;
154 args_info->cut_given = 0 ;
158 void clear_args (struct gengetopt_args_info *args_info)
160 FIX_UNUSED (args_info);
161 args_info->dangle_arg = 2;
162 args_info->dangle_orig = NULL;
163 args_info->Temp_arg = 37;
164 args_info->Temp_orig = NULL;
165 args_info->Par_arg = NULL;
166 args_info->Par_orig = NULL;
167 args_info->logML_flag = 1;
168 args_info->noShift_flag = 0;
169 args_info->noLP_flag = 0;
170 args_info->seed_arg = gengetopt_strdup ("clock");
171 args_info->seed_orig = NULL;
172 args_info->time_arg = 500;
173 args_info->time_orig = NULL;
174 args_info->num_arg = 1;
175 args_info->num_orig = NULL;
176 args_info->start_flag = 0;
177 args_info->stop_flag = 0;
178 args_info->met_flag = 0;
179 args_info->fpt_flag = 1;
180 args_info->grow_arg = 0;
181 args_info->grow_orig = NULL;
182 args_info->glen_arg = 15;
183 args_info->glen_orig = NULL;
184 args_info->phi_orig = NULL;
185 args_info->pbounds_arg = NULL;
186 args_info->pbounds_orig = NULL;
187 args_info->log_arg = gengetopt_strdup ("kinout");
188 args_info->log_orig = NULL;
189 args_info->silent_flag = 0;
190 args_info->verbose_flag = 0;
191 args_info->lmin_flag = 0;
192 args_info->cut_arg = 20;
193 args_info->cut_orig = NULL;
198 void init_args_info(struct gengetopt_args_info *args_info)
202 args_info->help_help = gengetopt_args_info_full_help[0] ;
203 args_info->full_help_help = gengetopt_args_info_full_help[1] ;
204 args_info->version_help = gengetopt_args_info_full_help[2] ;
205 args_info->dangle_help = gengetopt_args_info_full_help[4] ;
206 args_info->Temp_help = gengetopt_args_info_full_help[5] ;
207 args_info->Par_help = gengetopt_args_info_full_help[6] ;
208 args_info->logML_help = gengetopt_args_info_full_help[7] ;
209 args_info->noShift_help = gengetopt_args_info_full_help[9] ;
210 args_info->noLP_help = gengetopt_args_info_full_help[10] ;
211 args_info->seed_help = gengetopt_args_info_full_help[12] ;
212 args_info->time_help = gengetopt_args_info_full_help[13] ;
213 args_info->num_help = gengetopt_args_info_full_help[14] ;
214 args_info->start_help = gengetopt_args_info_full_help[15] ;
215 args_info->stop_help = gengetopt_args_info_full_help[16] ;
216 args_info->met_help = gengetopt_args_info_full_help[17] ;
217 args_info->fpt_help = gengetopt_args_info_full_help[18] ;
218 args_info->grow_help = gengetopt_args_info_full_help[19] ;
219 args_info->glen_help = gengetopt_args_info_full_help[20] ;
220 args_info->phi_help = gengetopt_args_info_full_help[21] ;
221 args_info->pbounds_help = gengetopt_args_info_full_help[22] ;
222 args_info->log_help = gengetopt_args_info_full_help[24] ;
223 args_info->silent_help = gengetopt_args_info_full_help[25] ;
224 args_info->verbose_help = gengetopt_args_info_full_help[26] ;
225 args_info->lmin_help = gengetopt_args_info_full_help[27] ;
226 args_info->cut_help = gengetopt_args_info_full_help[28] ;
231 cmdline_parser_print_version (void)
234 (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
235 CMDLINE_PARSER_VERSION);
238 static void print_help_common(void) {
239 cmdline_parser_print_version ();
241 if (strlen(gengetopt_args_info_purpose) > 0)
242 printf("\n%s\n", gengetopt_args_info_purpose);
244 if (strlen(gengetopt_args_info_usage) > 0)
245 printf("\n%s\n", gengetopt_args_info_usage);
249 if (strlen(gengetopt_args_info_description) > 0)
250 printf("%s\n\n", gengetopt_args_info_description);
254 cmdline_parser_print_help (void)
258 while (gengetopt_args_info_help[i])
259 printf("%s\n", gengetopt_args_info_help[i++]);
263 cmdline_parser_print_full_help (void)
267 while (gengetopt_args_info_full_help[i])
268 printf("%s\n", gengetopt_args_info_full_help[i++]);
272 cmdline_parser_init (struct gengetopt_args_info *args_info)
274 clear_given (args_info);
275 clear_args (args_info);
276 init_args_info (args_info);
280 cmdline_parser_params_init(struct cmdline_parser_params *params)
284 params->override = 0;
285 params->initialize = 1;
286 params->check_required = 1;
287 params->check_ambiguity = 0;
288 params->print_errors = 1;
292 struct cmdline_parser_params *
293 cmdline_parser_params_create(void)
295 struct cmdline_parser_params *params =
296 (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
297 cmdline_parser_params_init(params);
302 free_string_field (char **s)
313 cmdline_parser_release (struct gengetopt_args_info *args_info)
316 free_string_field (&(args_info->dangle_orig));
317 free_string_field (&(args_info->Temp_orig));
318 free_string_field (&(args_info->Par_arg));
319 free_string_field (&(args_info->Par_orig));
320 free_string_field (&(args_info->seed_arg));
321 free_string_field (&(args_info->seed_orig));
322 free_string_field (&(args_info->time_orig));
323 free_string_field (&(args_info->num_orig));
324 free_string_field (&(args_info->grow_orig));
325 free_string_field (&(args_info->glen_orig));
326 free_string_field (&(args_info->phi_orig));
327 free_string_field (&(args_info->pbounds_arg));
328 free_string_field (&(args_info->pbounds_orig));
329 free_string_field (&(args_info->log_arg));
330 free_string_field (&(args_info->log_orig));
331 free_string_field (&(args_info->cut_orig));
335 clear_given (args_info);
339 * @param val the value to check
340 * @param values the possible values
341 * @return the index of the matched value:
342 * -1 if no value matched,
343 * -2 if more than one value has matched
346 check_possible_values(const char *val, const char *values[])
351 if (!val) /* otherwise strlen() crashes below */
352 return -1; /* -1 means no argument for the option */
356 for (i = 0, len = strlen(val); values[i]; ++i)
358 if (strncmp(val, values[i], len) == 0)
362 if (strlen(values[i]) == len)
363 return i; /* exact macth no need to check more */
367 if (found == 1) /* one match: OK */
370 return (found ? -2 : -1); /* return many values or none matched */
375 write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
380 found = check_possible_values(arg, values);
383 fprintf(outfile, "%s=\"%s\" # %s\n", opt, arg, values[found]);
385 fprintf(outfile, "%s=\"%s\"\n", opt, arg);
387 fprintf(outfile, "%s\n", opt);
393 cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
399 fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
403 if (args_info->help_given)
404 write_into_file(outfile, "help", 0, 0 );
405 if (args_info->full_help_given)
406 write_into_file(outfile, "full-help", 0, 0 );
407 if (args_info->version_given)
408 write_into_file(outfile, "version", 0, 0 );
409 if (args_info->dangle_given)
410 write_into_file(outfile, "dangle", args_info->dangle_orig, cmdline_parser_dangle_values);
411 if (args_info->Temp_given)
412 write_into_file(outfile, "Temp", args_info->Temp_orig, 0);
413 if (args_info->Par_given)
414 write_into_file(outfile, "Par", args_info->Par_orig, 0);
415 if (args_info->logML_given)
416 write_into_file(outfile, "logML", 0, 0 );
417 if (args_info->noShift_given)
418 write_into_file(outfile, "noShift", 0, 0 );
419 if (args_info->noLP_given)
420 write_into_file(outfile, "noLP", 0, 0 );
421 if (args_info->seed_given)
422 write_into_file(outfile, "seed", args_info->seed_orig, 0);
423 if (args_info->time_given)
424 write_into_file(outfile, "time", args_info->time_orig, 0);
425 if (args_info->num_given)
426 write_into_file(outfile, "num", args_info->num_orig, 0);
427 if (args_info->start_given)
428 write_into_file(outfile, "start", 0, 0 );
429 if (args_info->stop_given)
430 write_into_file(outfile, "stop", 0, 0 );
431 if (args_info->met_given)
432 write_into_file(outfile, "met", 0, 0 );
433 if (args_info->fpt_given)
434 write_into_file(outfile, "fpt", 0, 0 );
435 if (args_info->grow_given)
436 write_into_file(outfile, "grow", args_info->grow_orig, 0);
437 if (args_info->glen_given)
438 write_into_file(outfile, "glen", args_info->glen_orig, 0);
439 if (args_info->phi_given)
440 write_into_file(outfile, "phi", args_info->phi_orig, 0);
441 if (args_info->pbounds_given)
442 write_into_file(outfile, "pbounds", args_info->pbounds_orig, 0);
443 if (args_info->log_given)
444 write_into_file(outfile, "log", args_info->log_orig, 0);
445 if (args_info->silent_given)
446 write_into_file(outfile, "silent", 0, 0 );
447 if (args_info->verbose_given)
448 write_into_file(outfile, "verbose", 0, 0 );
449 if (args_info->lmin_given)
450 write_into_file(outfile, "lmin", 0, 0 );
451 if (args_info->cut_given)
452 write_into_file(outfile, "cut", args_info->cut_orig, 0);
460 cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
465 outfile = fopen(filename, "w");
469 fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
473 i = cmdline_parser_dump(outfile, args_info);
480 cmdline_parser_free (struct gengetopt_args_info *args_info)
482 cmdline_parser_release (args_info);
485 /** @brief replacement of strdup, which is not standard */
487 gengetopt_strdup (const char *s)
493 result = (char*)malloc(strlen(s) + 1);
494 if (result == (char*)0)
501 cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
503 return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
507 cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
508 struct cmdline_parser_params *params)
511 result = cmdline_parser_internal (argc, argv, args_info, params, 0);
513 if (result == EXIT_FAILURE)
515 cmdline_parser_free (args_info);
523 cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
526 struct cmdline_parser_params params;
528 params.override = override;
529 params.initialize = initialize;
530 params.check_required = check_required;
531 params.check_ambiguity = 0;
532 params.print_errors = 1;
534 result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0);
536 if (result == EXIT_FAILURE)
538 cmdline_parser_free (args_info);
546 cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
548 FIX_UNUSED (args_info);
549 FIX_UNUSED (prog_name);
554 * Extracted from the glibc source tree, version 2.3.6
556 * Licensed under the GPL as per the whole glibc source tree.
558 * This file was modified so that getopt_long can be called
559 * many times without risking previous memory to be spoiled.
561 * Modified by Andre Noll and Lorenzo Bettini for use in
562 * GNU gengetopt generated files.
567 * we must include anything we need since this file is not thought to be
568 * inserted in a file already using getopt.h
576 /* has_arg can't be an enum because some compilers complain about
577 type mismatches in all the code that assumes it is an int. */
583 /* This version of `getopt' appears to the caller like standard Unix `getopt'
584 but it behaves differently for the user, since it allows the user
585 to intersperse the options with the other arguments.
587 As `getopt' works, it permutes the elements of ARGV so that,
588 when it is done, all the options precede everything else. Thus
589 all application programs are extended to handle flexible argument order.
592 If the field `flag' is not NULL, it points to a variable that is set
593 to the value given in the field `val' when the option is found, but
594 left unchanged if the option is not found.
596 To have a long-named option do something other than set an `int' to
597 a compiled-in constant, such as set a value from `custom_optarg', set the
598 option's `flag' field to zero and its `val' field to a nonzero
599 value (the equivalent single-letter option character, if there is
600 one). For long options that have a zero `flag' field, `getopt'
601 returns the contents of the `val' field. */
603 /* Names for the values of the `has_arg' field of `struct option'. */
605 #define no_argument 0
608 #ifndef required_argument
609 #define required_argument 1
612 #ifndef optional_argument
613 #define optional_argument 2
616 struct custom_getopt_data {
618 * These have exactly the same meaning as the corresponding global variables,
619 * except that they are used for the reentrant versions of getopt.
626 /* True if the internal members have been initialized. */
630 * The next char to be scanned in the option-element in which the last option
631 * character we returned was found. This allows us to pick up the scan where
632 * we left off. If this is zero, or a null string, it means resume the scan by
633 * advancing to the next ARGV-element.
638 * Describe the part of ARGV that contains non-options that have been skipped.
639 * `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is
640 * the index after the last of them.
647 * the variables optarg, optind, opterr and optopt are renamed with
648 * the custom_ prefix so that they don't interfere with getopt ones.
650 * Moreover they're static so they are visible only from within the
651 * file where this very file will be included.
655 * For communication from `custom_getopt' to the caller. When `custom_getopt' finds an
656 * option that takes an argument, the argument value is returned here.
658 static char *custom_optarg;
661 * Index in ARGV of the next element to be scanned. This is used for
662 * communication to and from the caller and for communication between
663 * successive calls to `custom_getopt'.
665 * On entry to `custom_getopt', 1 means this is the first call; initialize.
667 * When `custom_getopt' returns -1, this is the index of the first of the non-option
668 * elements that the caller should itself scan.
670 * Otherwise, `custom_optind' communicates from one call to the next how much of ARGV
671 * has been scanned so far.
673 * 1003.2 says this must be 1 before any call.
675 static int custom_optind = 1;
678 * Callers store zero here to inhibit the error message for unrecognized
681 static int custom_opterr = 1;
684 * Set to an option character which was unrecognized. This must be initialized
685 * on some systems to avoid linking in the system's own getopt implementation.
687 static int custom_optopt = '?';
690 * Exchange two adjacent subsequences of ARGV. One subsequence is elements
691 * [first_nonopt,last_nonopt) which contains all the non-options that have been
692 * skipped so far. The other is elements [last_nonopt,custom_optind), which contains
693 * all the options processed since those non-options were skipped.
694 * `first_nonopt' and `last_nonopt' are relocated so that they describe the new
695 * indices of the non-options in ARGV after they are moved.
697 static void exchange(char **argv, struct custom_getopt_data *d)
699 int bottom = d->first_nonopt;
700 int middle = d->last_nonopt;
701 int top = d->custom_optind;
705 * Exchange the shorter segment with the far end of the longer segment.
706 * That puts the shorter segment into the right place. It leaves the
707 * longer segment in the right place overall, but it consists of two
708 * parts that need to be swapped next.
710 while (top > middle && middle > bottom) {
711 if (top - middle > middle - bottom) {
712 /* Bottom segment is the short one. */
713 int len = middle - bottom;
716 /* Swap it with the top part of the top segment. */
717 for (i = 0; i < len; i++) {
718 tem = argv[bottom + i];
720 argv[top - (middle - bottom) + i];
721 argv[top - (middle - bottom) + i] = tem;
723 /* Exclude the moved bottom segment from further swapping. */
726 /* Top segment is the short one. */
727 int len = top - middle;
730 /* Swap it with the bottom part of the bottom segment. */
731 for (i = 0; i < len; i++) {
732 tem = argv[bottom + i];
733 argv[bottom + i] = argv[middle + i];
734 argv[middle + i] = tem;
736 /* Exclude the moved top segment from further swapping. */
740 /* Update records for the slots the non-options now occupy. */
741 d->first_nonopt += (d->custom_optind - d->last_nonopt);
742 d->last_nonopt = d->custom_optind;
745 /* Initialize the internal data when the first call is made. */
746 static void custom_getopt_initialize(struct custom_getopt_data *d)
749 * Start processing options with ARGV-element 1 (since ARGV-element 0
750 * is the program name); the sequence of previously skipped non-option
751 * ARGV-elements is empty.
753 d->first_nonopt = d->last_nonopt = d->custom_optind;
758 #define NONOPTION_P (argv[d->custom_optind][0] != '-' || argv[d->custom_optind][1] == '\0')
760 /* return: zero: continue, nonzero: return given value to user */
761 static int shuffle_argv(int argc, char *const *argv,const struct option *longopts,
762 struct custom_getopt_data *d)
765 * Give FIRST_NONOPT & LAST_NONOPT rational values if CUSTOM_OPTIND has been
766 * moved back by the user (who may also have changed the arguments).
768 if (d->last_nonopt > d->custom_optind)
769 d->last_nonopt = d->custom_optind;
770 if (d->first_nonopt > d->custom_optind)
771 d->first_nonopt = d->custom_optind;
773 * If we have just processed some options following some
774 * non-options, exchange them so that the options come first.
776 if (d->first_nonopt != d->last_nonopt &&
777 d->last_nonopt != d->custom_optind)
778 exchange((char **) argv, d);
779 else if (d->last_nonopt != d->custom_optind)
780 d->first_nonopt = d->custom_optind;
782 * Skip any additional non-options and extend the range of
783 * non-options previously skipped.
785 while (d->custom_optind < argc && NONOPTION_P)
787 d->last_nonopt = d->custom_optind;
789 * The special ARGV-element `--' means premature end of options. Skip
790 * it like a null option, then exchange with previous non-options as if
791 * it were an option, then skip everything else like a non-option.
793 if (d->custom_optind != argc && !strcmp(argv[d->custom_optind], "--")) {
795 if (d->first_nonopt != d->last_nonopt
796 && d->last_nonopt != d->custom_optind)
797 exchange((char **) argv, d);
798 else if (d->first_nonopt == d->last_nonopt)
799 d->first_nonopt = d->custom_optind;
800 d->last_nonopt = argc;
801 d->custom_optind = argc;
804 * If we have done all the ARGV-elements, stop the scan and back over
805 * any non-options that we skipped and permuted.
807 if (d->custom_optind == argc) {
809 * Set the next-arg-index to point at the non-options that we
810 * previously skipped, so the caller will digest them.
812 if (d->first_nonopt != d->last_nonopt)
813 d->custom_optind = d->first_nonopt;
817 * If we have come to a non-option and did not permute it, either stop
818 * the scan or describe it to the caller and pass it by.
821 d->custom_optarg = argv[d->custom_optind++];
825 * We have found another option-ARGV-element. Skip the initial
828 d->nextchar = (argv[d->custom_optind] + 1 + (longopts != NULL && argv[d->custom_optind][1] == '-'));
833 * Check whether the ARGV-element is a long option.
835 * If there's a long option "fubar" and the ARGV-element is "-fu", consider
836 * that an abbreviation of the long option, just like "--fu", and not "-f" with
839 * This distinction seems to be the most useful approach.
842 static int check_long_opt(int argc, char *const *argv, const char *optstring,
843 const struct option *longopts, int *longind,
844 int print_errors, struct custom_getopt_data *d)
847 const struct option *p;
848 const struct option *pfound = NULL;
854 for (nameend = d->nextchar; *nameend && *nameend != '='; nameend++)
857 /* Test all long options for either exact match or abbreviated matches */
858 for (p = longopts, option_index = 0; p->name; p++, option_index++)
859 if (!strncmp(p->name, d->nextchar, nameend - d->nextchar)) {
860 if ((unsigned int) (nameend - d->nextchar)
861 == (unsigned int) strlen(p->name)) {
862 /* Exact match found. */
864 indfound = option_index;
867 } else if (pfound == NULL) {
868 /* First nonexact match found. */
870 indfound = option_index;
871 } else if (pfound->has_arg != p->has_arg
872 || pfound->flag != p->flag
873 || pfound->val != p->val)
874 /* Second or later nonexact match found. */
877 if (ambig && !exact) {
880 "%s: option `%s' is ambiguous\n",
881 argv[0], argv[d->custom_optind]);
883 d->nextchar += strlen(d->nextchar);
885 d->custom_optopt = 0;
889 option_index = indfound;
892 if (pfound->has_arg != no_argument)
893 d->custom_optarg = nameend + 1;
896 if (argv[d->custom_optind - 1][1] == '-') {
898 fprintf(stderr, "%s: option `--%s' doesn't allow an argument\n",
899 argv[0], pfound->name);
901 /* +option or -option */
902 fprintf(stderr, "%s: option `%c%s' doesn't allow an argument\n",
903 argv[0], argv[d->custom_optind - 1][0], pfound->name);
907 d->nextchar += strlen(d->nextchar);
908 d->custom_optopt = pfound->val;
911 } else if (pfound->has_arg == required_argument) {
912 if (d->custom_optind < argc)
913 d->custom_optarg = argv[d->custom_optind++];
917 "%s: option `%s' requires an argument\n",
919 argv[d->custom_optind - 1]);
921 d->nextchar += strlen(d->nextchar);
922 d->custom_optopt = pfound->val;
923 return optstring[0] == ':' ? ':' : '?';
926 d->nextchar += strlen(d->nextchar);
928 *longind = option_index;
930 *(pfound->flag) = pfound->val;
936 * Can't find it as a long option. If this is not getopt_long_only, or
937 * the option starts with '--' or is not a valid short option, then
938 * it's an error. Otherwise interpret it as a short option.
941 if (argv[d->custom_optind][1] == '-') {
944 "%s: unrecognized option `--%s'\n",
945 argv[0], d->nextchar);
947 /* +option or -option */
949 "%s: unrecognized option `%c%s'\n",
950 argv[0], argv[d->custom_optind][0],
954 d->nextchar = (char *) "";
956 d->custom_optopt = 0;
960 static int check_short_opt(int argc, char *const *argv, const char *optstring,
961 int print_errors, struct custom_getopt_data *d)
963 char c = *d->nextchar++;
964 const char *temp = strchr(optstring, c);
966 /* Increment `custom_optind' when we start to process its last character. */
967 if (*d->nextchar == '\0')
969 if (!temp || c == ':') {
971 fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c);
973 d->custom_optopt = c;
976 if (temp[1] == ':') {
977 if (temp[2] == ':') {
978 /* This is an option that accepts an argument optionally. */
979 if (*d->nextchar != '\0') {
980 d->custom_optarg = d->nextchar;
983 d->custom_optarg = NULL;
986 /* This is an option that requires an argument. */
987 if (*d->nextchar != '\0') {
988 d->custom_optarg = d->nextchar;
990 * If we end this ARGV-element by taking the
991 * rest as an arg, we must advance to the next
995 } else if (d->custom_optind == argc) {
998 "%s: option requires an argument -- %c\n",
1001 d->custom_optopt = c;
1002 if (optstring[0] == ':')
1008 * We already incremented `custom_optind' once;
1009 * increment it again when taking next ARGV-elt
1012 d->custom_optarg = argv[d->custom_optind++];
1020 * Scan elements of ARGV for option characters given in OPTSTRING.
1022 * If an element of ARGV starts with '-', and is not exactly "-" or "--",
1023 * then it is an option element. The characters of this element
1024 * (aside from the initial '-') are option characters. If `getopt'
1025 * is called repeatedly, it returns successively each of the option characters
1026 * from each of the option elements.
1028 * If `getopt' finds another option character, it returns that character,
1029 * updating `custom_optind' and `nextchar' so that the next call to `getopt' can
1030 * resume the scan with the following option character or ARGV-element.
1032 * If there are no more option characters, `getopt' returns -1.
1033 * Then `custom_optind' is the index in ARGV of the first ARGV-element
1034 * that is not an option. (The ARGV-elements have been permuted
1035 * so that those that are not options now come last.)
1037 * OPTSTRING is a string containing the legitimate option characters.
1038 * If an option character is seen that is not listed in OPTSTRING,
1039 * return '?' after printing an error message. If you set `custom_opterr' to
1040 * zero, the error message is suppressed but we still return '?'.
1042 * If a char in OPTSTRING is followed by a colon, that means it wants an arg,
1043 * so the following text in the same ARGV-element, or the text of the following
1044 * ARGV-element, is returned in `custom_optarg'. Two colons mean an option that
1045 * wants an optional arg; if there is text in the current ARGV-element,
1046 * it is returned in `custom_optarg', otherwise `custom_optarg' is set to zero.
1048 * If OPTSTRING starts with `-' or `+', it requests different methods of
1049 * handling the non-option ARGV-elements.
1050 * See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
1052 * Long-named options begin with `--' instead of `-'.
1053 * Their names may be abbreviated as long as the abbreviation is unique
1054 * or is an exact match for some defined option. If they have an
1055 * argument, it follows the option name in the same ARGV-element, separated
1056 * from the option name by a `=', or else the in next ARGV-element.
1057 * When `getopt' finds a long-named option, it returns 0 if that option's
1058 * `flag' field is nonzero, the value of the option's `val' field
1059 * if the `flag' field is zero.
1061 * The elements of ARGV aren't really const, because we permute them.
1062 * But we pretend they're const in the prototype to be compatible
1063 * with other systems.
1065 * LONGOPTS is a vector of `struct option' terminated by an
1066 * element containing a name which is zero.
1068 * LONGIND returns the index in LONGOPT of the long-named option found.
1069 * It is only valid when a long-named option has been found by the most
1072 * Return the option character from OPTS just read. Return -1 when there are
1073 * no more options. For unrecognized options, or options missing arguments,
1074 * `custom_optopt' is set to the option letter, and '?' is returned.
1076 * The OPTS string is a list of characters which are recognized option letters,
1077 * optionally followed by colons, specifying that that letter takes an
1078 * argument, to be placed in `custom_optarg'.
1080 * If a letter in OPTS is followed by two colons, its argument is optional.
1081 * This behavior is specific to the GNU `getopt'.
1083 * The argument `--' causes premature termination of argument scanning,
1084 * explicitly telling `getopt' that there are no more options. If OPTS begins
1085 * with `--', then non-option arguments are treated as arguments to the option
1086 * '\0'. This behavior is specific to the GNU `getopt'.
1089 static int getopt_internal_r(int argc, char *const *argv, const char *optstring,
1090 const struct option *longopts, int *longind,
1091 struct custom_getopt_data *d)
1093 int ret, print_errors = d->custom_opterr;
1095 if (optstring[0] == ':')
1099 d->custom_optarg = NULL;
1102 * This is a big difference with GNU getopt, since optind == 0
1103 * means initialization while here 1 means first call.
1105 if (d->custom_optind == 0 || !d->initialized) {
1106 if (d->custom_optind == 0)
1107 d->custom_optind = 1; /* Don't scan ARGV[0], the program name. */
1108 custom_getopt_initialize(d);
1110 if (d->nextchar == NULL || *d->nextchar == '\0') {
1111 ret = shuffle_argv(argc, argv, longopts, d);
1115 if (longopts && (argv[d->custom_optind][1] == '-' ))
1116 return check_long_opt(argc, argv, optstring, longopts,
1117 longind, print_errors, d);
1118 return check_short_opt(argc, argv, optstring, print_errors, d);
1121 static int custom_getopt_internal(int argc, char *const *argv, const char *optstring,
1122 const struct option *longopts, int *longind)
1125 /* Keep a global copy of all internal members of d */
1126 static struct custom_getopt_data d;
1128 d.custom_optind = custom_optind;
1129 d.custom_opterr = custom_opterr;
1130 result = getopt_internal_r(argc, argv, optstring, longopts,
1132 custom_optind = d.custom_optind;
1133 custom_optarg = d.custom_optarg;
1134 custom_optopt = d.custom_optopt;
1138 static int custom_getopt_long (int argc, char *const *argv, const char *options,
1139 const struct option *long_options, int *opt_index)
1141 return custom_getopt_internal(argc, argv, options, long_options,
1146 static char *package_name = 0;
1149 * @brief updates an option
1150 * @param field the generic pointer to the field to update
1151 * @param orig_field the pointer to the orig field
1152 * @param field_given the pointer to the number of occurrence of this option
1153 * @param prev_given the pointer to the number of occurrence already seen
1154 * @param value the argument for this option (if null no arg was specified)
1155 * @param possible_values the possible values for this option (if specified)
1156 * @param default_value the default value (in case the option only accepts fixed values)
1157 * @param arg_type the type of this option
1158 * @param check_ambiguity @see cmdline_parser_params.check_ambiguity
1159 * @param override @see cmdline_parser_params.override
1160 * @param no_free whether to free a possible previous value
1161 * @param multiple_option whether this is a multiple option
1162 * @param long_opt the corresponding long option
1163 * @param short_opt the corresponding short option (or '-' if none)
1164 * @param additional_error possible further error specification
1167 int update_arg(void *field, char **orig_field,
1168 unsigned int *field_given, unsigned int *prev_given,
1169 char *value, const char *possible_values[],
1170 const char *default_value,
1171 cmdline_parser_arg_type arg_type,
1172 int check_ambiguity, int override,
1173 int no_free, int multiple_option,
1174 const char *long_opt, char short_opt,
1175 const char *additional_error)
1177 char *stop_char = 0;
1178 const char *val = value;
1180 char **string_field;
1186 if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
1188 if (short_opt != '-')
1189 fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n",
1190 package_name, long_opt, short_opt,
1191 (additional_error ? additional_error : ""));
1193 fprintf (stderr, "%s: `--%s' option given more than once%s\n",
1194 package_name, long_opt,
1195 (additional_error ? additional_error : ""));
1196 return 1; /* failure */
1199 if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0)
1201 if (short_opt != '-')
1202 fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n",
1203 package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, short_opt,
1204 (additional_error ? additional_error : ""));
1206 fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s'%s\n",
1207 package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt,
1208 (additional_error ? additional_error : ""));
1209 return 1; /* failure */
1212 if (field_given && *field_given && ! override)
1218 if (possible_values)
1219 val = possible_values[found];
1223 *((int *)field) = !*((int *)field);
1226 if (val) *((int *)field) = strtol (val, &stop_char, 0);
1229 if (val) *((float *)field) = (float)strtod (val, &stop_char);
1232 if (val) *((double *)field) = strtod (val, &stop_char);
1236 string_field = (char **)field;
1237 if (!no_free && *string_field)
1238 free (*string_field); /* free previous string */
1239 *string_field = gengetopt_strdup (val);
1246 /* check numeric conversion */
1251 if (val && !(stop_char && *stop_char == '\0')) {
1252 fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val);
1253 return 1; /* failure */
1260 /* store the original value */
1266 if (value && orig_field) {
1268 *orig_field = value;
1271 free (*orig_field); /* free previous string */
1272 *orig_field = gengetopt_strdup (value);
1282 cmdline_parser_internal (
1283 int argc, char **argv, struct gengetopt_args_info *args_info,
1284 struct cmdline_parser_params *params, const char *additional_error)
1286 int c; /* Character of the parsed option. */
1289 struct gengetopt_args_info local_args_info;
1294 int check_ambiguity;
1301 package_name = argv[0];
1303 override = params->override;
1304 initialize = params->initialize;
1305 check_required = params->check_required;
1306 check_ambiguity = params->check_ambiguity;
1309 cmdline_parser_init (args_info);
1311 cmdline_parser_init (&local_args_info);
1315 opterr = params->print_errors;
1320 int option_index = 0;
1322 static struct option long_options[] = {
1323 { "help", 0, NULL, 'h' },
1324 { "full-help", 0, NULL, 0 },
1325 { "version", 0, NULL, 'V' },
1326 { "dangle", 1, NULL, 'd' },
1327 { "Temp", 1, NULL, 'T' },
1328 { "Par", 1, NULL, 'P' },
1329 { "logML", 0, NULL, 0 },
1330 { "noShift", 0, NULL, 0 },
1331 { "noLP", 0, NULL, 0 },
1332 { "seed", 1, NULL, 0 },
1333 { "time", 1, NULL, 0 },
1334 { "num", 1, NULL, 0 },
1335 { "start", 0, NULL, 0 },
1336 { "stop", 0, NULL, 0 },
1337 { "met", 0, NULL, 0 },
1338 { "fpt", 0, NULL, 0 },
1339 { "grow", 1, NULL, 0 },
1340 { "glen", 1, NULL, 0 },
1341 { "phi", 1, NULL, 0 },
1342 { "pbounds", 1, NULL, 0 },
1343 { "log", 1, NULL, 0 },
1344 { "silent", 0, NULL, 'q' },
1345 { "verbose", 0, NULL, 'v' },
1346 { "lmin", 0, NULL, 0 },
1347 { "cut", 1, NULL, 0 },
1351 custom_optarg = optarg;
1352 custom_optind = optind;
1353 custom_opterr = opterr;
1354 custom_optopt = optopt;
1356 c = custom_getopt_long (argc, argv, "hVd:T:P:qv", long_options, &option_index);
1358 optarg = custom_optarg;
1359 optind = custom_optind;
1360 opterr = custom_opterr;
1361 optopt = custom_optopt;
1363 if (c == -1) break; /* Exit from `while (1)' loop. */
1367 case 'h': /* Print help and exit. */
1368 cmdline_parser_print_help ();
1369 cmdline_parser_free (&local_args_info);
1370 exit (EXIT_SUCCESS);
1372 case 'V': /* Print version and exit. */
1373 cmdline_parser_print_version ();
1374 cmdline_parser_free (&local_args_info);
1375 exit (EXIT_SUCCESS);
1377 case 'd': /* <0|1|2> set dangling end model to (none|normal|double). */
1380 if (update_arg( (void *)&(args_info->dangle_arg),
1381 &(args_info->dangle_orig), &(args_info->dangle_given),
1382 &(local_args_info.dangle_given), optarg, cmdline_parser_dangle_values, "2", ARG_INT,
1383 check_ambiguity, override, 0, 0,
1389 case 'T': /* simulation temperature. */
1392 if (update_arg( (void *)&(args_info->Temp_arg),
1393 &(args_info->Temp_orig), &(args_info->Temp_given),
1394 &(local_args_info.Temp_given), optarg, 0, "37", ARG_FLOAT,
1395 check_ambiguity, override, 0, 0,
1401 case 'P': /* read energy-parameter-file. */
1404 if (update_arg( (void *)&(args_info->Par_arg),
1405 &(args_info->Par_orig), &(args_info->Par_given),
1406 &(local_args_info.Par_given), optarg, 0, 0, ARG_STRING,
1407 check_ambiguity, override, 0, 0,
1413 case 'q': /* no output to stdout. */
1416 if (update_arg((void *)&(args_info->silent_flag), 0, &(args_info->silent_given),
1417 &(local_args_info.silent_given), optarg, 0, 0, ARG_FLAG,
1418 check_ambiguity, override, 1, 0, "silent", 'q',
1423 case 'v': /* more information to stdout. */
1426 if (update_arg((void *)&(args_info->verbose_flag), 0, &(args_info->verbose_given),
1427 &(local_args_info.verbose_given), optarg, 0, 0, ARG_FLAG,
1428 check_ambiguity, override, 1, 0, "verbose", 'v',
1434 case 0: /* Long option with no short option */
1435 if (strcmp (long_options[option_index].name, "full-help") == 0) {
1436 cmdline_parser_print_full_help ();
1437 cmdline_parser_free (&local_args_info);
1438 exit (EXIT_SUCCESS);
1441 /* use logarithmic multiloop energies instead of linear. */
1442 if (strcmp (long_options[option_index].name, "logML") == 0)
1446 if (update_arg((void *)&(args_info->logML_flag), 0, &(args_info->logML_given),
1447 &(local_args_info.logML_given), optarg, 0, 0, ARG_FLAG,
1448 check_ambiguity, override, 1, 0, "logML", '-',
1453 /* turn off shift-moves. */
1454 else if (strcmp (long_options[option_index].name, "noShift") == 0)
1458 if (update_arg((void *)&(args_info->noShift_flag), 0, &(args_info->noShift_given),
1459 &(local_args_info.noShift_given), optarg, 0, 0, ARG_FLAG,
1460 check_ambiguity, override, 1, 0, "noShift", '-',
1465 /* forbid structures with isolated base-pairs. */
1466 else if (strcmp (long_options[option_index].name, "noLP") == 0)
1470 if (update_arg((void *)&(args_info->noLP_flag), 0, &(args_info->noLP_given),
1471 &(local_args_info.noLP_given), optarg, 0, 0, ARG_FLAG,
1472 check_ambiguity, override, 1, 0, "noLP", '-',
1477 /* set random number seed specify 3 integers as int=int=int. */
1478 else if (strcmp (long_options[option_index].name, "seed") == 0)
1482 if (update_arg( (void *)&(args_info->seed_arg),
1483 &(args_info->seed_orig), &(args_info->seed_given),
1484 &(local_args_info.seed_given), optarg, 0, "clock", ARG_STRING,
1485 check_ambiguity, override, 0, 0,
1491 /* set maxtime of simulation. */
1492 else if (strcmp (long_options[option_index].name, "time") == 0)
1496 if (update_arg( (void *)&(args_info->time_arg),
1497 &(args_info->time_orig), &(args_info->time_given),
1498 &(local_args_info.time_given), optarg, 0, "500", ARG_FLOAT,
1499 check_ambiguity, override, 0, 0,
1505 /* set number of trajectories. */
1506 else if (strcmp (long_options[option_index].name, "num") == 0)
1510 if (update_arg( (void *)&(args_info->num_arg),
1511 &(args_info->num_orig), &(args_info->num_given),
1512 &(local_args_info.num_given), optarg, 0, "1", ARG_INT,
1513 check_ambiguity, override, 0, 0,
1519 /* read start structure from stdin (otherwise use open chain). */
1520 else if (strcmp (long_options[option_index].name, "start") == 0)
1524 if (update_arg((void *)&(args_info->start_flag), 0, &(args_info->start_given),
1525 &(local_args_info.start_given), optarg, 0, 0, ARG_FLAG,
1526 check_ambiguity, override, 1, 0, "start", '-',
1531 /* read stop structure(s) from stdin (optherwise use MFE). */
1532 else if (strcmp (long_options[option_index].name, "stop") == 0)
1536 if (update_arg((void *)&(args_info->stop_flag), 0, &(args_info->stop_given),
1537 &(local_args_info.stop_given), optarg, 0, 0, ARG_FLAG,
1538 check_ambiguity, override, 1, 0, "stop", '-',
1543 /* use Metropolis rule for rates (not Kawasaki rule). */
1544 else if (strcmp (long_options[option_index].name, "met") == 0)
1548 if (update_arg((void *)&(args_info->met_flag), 0, &(args_info->met_given),
1549 &(local_args_info.met_given), optarg, 0, 0, ARG_FLAG,
1550 check_ambiguity, override, 1, 0, "met", '-',
1555 /* compute first passage time (stop when a stop-structure is reached). */
1556 else if (strcmp (long_options[option_index].name, "fpt") == 0)
1560 if (update_arg((void *)&(args_info->fpt_flag), 0, &(args_info->fpt_given),
1561 &(local_args_info.fpt_given), optarg, 0, 0, ARG_FLAG,
1562 check_ambiguity, override, 1, 0, "fpt", '-',
1567 /* grow chain every <float> time units. */
1568 else if (strcmp (long_options[option_index].name, "grow") == 0)
1572 if (update_arg( (void *)&(args_info->grow_arg),
1573 &(args_info->grow_orig), &(args_info->grow_given),
1574 &(local_args_info.grow_given), optarg, 0, "0", ARG_FLOAT,
1575 check_ambiguity, override, 0, 0,
1581 /* initial size of growing chain. */
1582 else if (strcmp (long_options[option_index].name, "glen") == 0)
1586 if (update_arg( (void *)&(args_info->glen_arg),
1587 &(args_info->glen_orig), &(args_info->glen_given),
1588 &(local_args_info.glen_given), optarg, 0, "15", ARG_INT,
1589 check_ambiguity, override, 0, 0,
1595 /* set phi value. */
1596 else if (strcmp (long_options[option_index].name, "phi") == 0)
1600 if (update_arg( (void *)&(args_info->phi_arg),
1601 &(args_info->phi_orig), &(args_info->phi_given),
1602 &(local_args_info.phi_given), optarg, 0, 0, ARG_DOUBLE,
1603 check_ambiguity, override, 0, 0,
1609 /* specify 3 floats for phi_min, phi_inc, phi_max in the form <d1=d2=d3>. */
1610 else if (strcmp (long_options[option_index].name, "pbounds") == 0)
1614 if (update_arg( (void *)&(args_info->pbounds_arg),
1615 &(args_info->pbounds_orig), &(args_info->pbounds_given),
1616 &(local_args_info.pbounds_given), optarg, 0, 0, ARG_STRING,
1617 check_ambiguity, override, 0, 0,
1623 /* set basename of log-file. */
1624 else if (strcmp (long_options[option_index].name, "log") == 0)
1628 if (update_arg( (void *)&(args_info->log_arg),
1629 &(args_info->log_orig), &(args_info->log_given),
1630 &(local_args_info.log_given), optarg, 0, "kinout", ARG_STRING,
1631 check_ambiguity, override, 0, 0,
1637 /* output only local minima to stdout. */
1638 else if (strcmp (long_options[option_index].name, "lmin") == 0)
1642 if (update_arg((void *)&(args_info->lmin_flag), 0, &(args_info->lmin_given),
1643 &(local_args_info.lmin_given), optarg, 0, 0, ARG_FLAG,
1644 check_ambiguity, override, 1, 0, "lmin", '-',
1649 /* output structures with E <= <float> to stdout. */
1650 else if (strcmp (long_options[option_index].name, "cut") == 0)
1654 if (update_arg( (void *)&(args_info->cut_arg),
1655 &(args_info->cut_orig), &(args_info->cut_given),
1656 &(local_args_info.cut_given), optarg, 0, "20", ARG_FLOAT,
1657 check_ambiguity, override, 0, 0,
1665 case '?': /* Invalid option. */
1666 /* `getopt_long' already printed an error message. */
1669 default: /* bug: option not considered. */
1670 fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
1678 cmdline_parser_release (&local_args_info);
1681 return (EXIT_FAILURE);
1687 cmdline_parser_release (&local_args_info);
1688 return (EXIT_FAILURE);