# | Line 1 | Line 1 | |
---|---|---|
1 | /* | |
2 | < | File autogenerated by gengetopt version 2.19.1 |
2 | > | File autogenerated by gengetopt version 2.14 |
3 | generated with the following command: | |
4 | < | gengetopt -F DynamicPropsCmd |
4 | > | gengetopt -i DynamicProps.ggo -F DynamicPropsCmd |
5 | ||
6 | The developers of gengetopt consider the fixed text that goes in all | |
7 | gengetopt output files to be in the public domain: | |
# | Line 21 | Line 21 | |
21 | ||
22 | #include "DynamicPropsCmd.h" | |
23 | ||
24 | – | const char *gengetopt_args_info_purpose = ""; |
25 | – | |
26 | – | const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]..."; |
27 | – | |
28 | – | const char *gengetopt_args_info_description = ""; |
29 | – | |
30 | – | const char *gengetopt_args_info_help[] = { |
31 | – | " -h, --help Print help and exit", |
32 | – | " -V, --version Print version and exit", |
33 | – | " -i, --input=filename input dump file", |
34 | – | " -o, --output=filename output file name", |
35 | – | " --sele1=selection script select first stuntdouble set", |
36 | – | " --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)", |
37 | – | " --order=INT Lengendre Polynomial Order", |
38 | – | "\n Group: dynamicProps\n an option of this group is required", |
39 | – | " -r, --rcorr rmsd", |
40 | – | " -v, --vcorr velocity correlation function", |
41 | – | " -d, --dcorr dipole correlation function", |
42 | – | " -l, --lcorr Lengendre correlation function", |
43 | – | " --r_rcorr Radial rmsd", |
44 | – | " --thetacorr Angular rmsd", |
45 | – | " --drcorr Directional rmsd for particles with unit \n vectors", |
46 | – | 0 |
47 | – | }; |
48 | – | |
24 | static | |
25 | void clear_given (struct gengetopt_args_info *args_info); | |
26 | static | |
# | Line 77 | Line 52 | void clear_given (struct gengetopt_args_info *args_inf | |
52 | args_info->r_rcorr_given = 0 ; | |
53 | args_info->thetacorr_given = 0 ; | |
54 | args_info->drcorr_given = 0 ; | |
55 | + | args_info->helfandEcorr_given = 0 ; |
56 | args_info->dynamicProps_group_counter = 0 ; | |
57 | } | |
58 | ||
# | Line 95 | Line 71 | void clear_args (struct gengetopt_args_info *args_info | |
71 | ||
72 | } | |
73 | ||
98 | – | static |
99 | – | void init_args_info(struct gengetopt_args_info *args_info) |
100 | – | { |
101 | – | args_info->help_help = gengetopt_args_info_help[0] ; |
102 | – | args_info->version_help = gengetopt_args_info_help[1] ; |
103 | – | args_info->input_help = gengetopt_args_info_help[2] ; |
104 | – | args_info->output_help = gengetopt_args_info_help[3] ; |
105 | – | args_info->sele1_help = gengetopt_args_info_help[4] ; |
106 | – | args_info->sele2_help = gengetopt_args_info_help[5] ; |
107 | – | args_info->order_help = gengetopt_args_info_help[6] ; |
108 | – | args_info->rcorr_help = gengetopt_args_info_help[7] ; |
109 | – | args_info->vcorr_help = gengetopt_args_info_help[8] ; |
110 | – | args_info->dcorr_help = gengetopt_args_info_help[9] ; |
111 | – | args_info->lcorr_help = gengetopt_args_info_help[10] ; |
112 | – | args_info->r_rcorr_help = gengetopt_args_info_help[11] ; |
113 | – | args_info->thetacorr_help = gengetopt_args_info_help[12] ; |
114 | – | args_info->drcorr_help = gengetopt_args_info_help[13] ; |
115 | – | |
116 | – | } |
117 | – | |
74 | void | |
75 | cmdline_parser_print_version (void) | |
76 | { | |
# | Line 124 | Line 80 | cmdline_parser_print_help (void) | |
80 | void | |
81 | cmdline_parser_print_help (void) | |
82 | { | |
127 | – | int i = 0; |
83 | cmdline_parser_print_version (); | |
84 | < | |
85 | < | if (strlen(gengetopt_args_info_purpose) > 0) |
86 | < | printf("\n%s\n", gengetopt_args_info_purpose); |
87 | < | |
88 | < | printf("\n%s\n\n", gengetopt_args_info_usage); |
89 | < | |
90 | < | if (strlen(gengetopt_args_info_description) > 0) |
91 | < | printf("%s\n", gengetopt_args_info_description); |
92 | < | |
93 | < | while (gengetopt_args_info_help[i]) |
94 | < | printf("%s\n", gengetopt_args_info_help[i++]); |
84 | > | printf("\nUsage: DynamicProps [OPTIONS]...\n\n"); |
85 | > | printf("%s\n"," -h, --help Print help and exit"); |
86 | > | printf("%s\n"," -V, --version Print version and exit"); |
87 | > | printf("%s\n"," -i, --input=filename input dump file"); |
88 | > | printf("%s\n"," -o, --output=filename output file name"); |
89 | > | printf("%s\n"," --sele1=selection script select first stuntdouble set"); |
90 | > | printf("%s\n"," --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)"); |
91 | > | printf("%s\n"," --order=INT Lengendre Polynomial Order"); |
92 | > | printf("%s\n","\n Group: dynamicProps\n an option of this group is required"); |
93 | > | printf("%s\n"," -r, --rcorr rmsd"); |
94 | > | printf("%s\n"," -v, --vcorr velocity correlation function"); |
95 | > | printf("%s\n"," -d, --dcorr dipole correlation function"); |
96 | > | printf("%s\n"," -l, --lcorr Lengendre correlation function"); |
97 | > | printf("%s\n"," --r_rcorr Radial rmsd"); |
98 | > | printf("%s\n"," --thetacorr Angular rmsd"); |
99 | > | printf("%s\n"," --drcorr Directional rmsd for particles with unit \n vectors"); |
100 | > | printf("%s\n"," --helfandEcorr Helfand moment for thermal conductvity"); |
101 | > | |
102 | } | |
103 | ||
104 | void | |
# | Line 144 | Line 106 | cmdline_parser_init (struct gengetopt_args_info *args_ | |
106 | { | |
107 | clear_given (args_info); | |
108 | clear_args (args_info); | |
147 | – | init_args_info (args_info); |
109 | } | |
110 | ||
111 | static void | |
# | Line 276 | Line 237 | cmdline_parser_file_save(const char *filename, struct | |
237 | if (args_info->drcorr_given) { | |
238 | fprintf(outfile, "%s\n", "drcorr"); | |
239 | } | |
240 | + | if (args_info->helfandEcorr_given) { |
241 | + | fprintf(outfile, "%s\n", "helfandEcorr"); |
242 | + | } |
243 | ||
244 | fclose (outfile); | |
245 | ||
# | Line 322 | Line 286 | reset_group_dynamicProps(struct gengetopt_args_info *a | |
286 | args_info->r_rcorr_given = 0 ; | |
287 | args_info->thetacorr_given = 0 ; | |
288 | args_info->drcorr_given = 0 ; | |
289 | + | args_info->helfandEcorr_given = 0 ; |
290 | ||
291 | args_info->dynamicProps_group_counter = 0; | |
292 | } | |
# | Line 370 | Line 335 | cmdline_parser_required2 (struct gengetopt_args_info * | |
335 | { | |
336 | int error = 0; | |
337 | ||
373 | – | /* checks for required options */ |
338 | if (! args_info->input_given) | |
339 | { | |
340 | fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); | |
341 | error = 1; | |
342 | } | |
379 | – | |
343 | if (args_info->dynamicProps_group_counter == 0) | |
344 | { | |
345 | fprintf (stderr, "%s: %d options of group dynamicProps were given. One is required.%s\n", prog_name, args_info->dynamicProps_group_counter, (additional_error ? additional_error : "")); | |
# | Line 384 | Line 347 | cmdline_parser_required2 (struct gengetopt_args_info * | |
347 | } | |
348 | ||
349 | ||
387 | – | /* checks for dependences among options */ |
388 | – | |
350 | return error; | |
351 | } | |
352 | ||
# | Line 403 | Line 364 | cmdline_parser_internal (int argc, char * const *argv, | |
364 | cmdline_parser_init (&local_args_info); | |
365 | ||
366 | optarg = 0; | |
367 | < | optind = 0; |
367 | > | optind = 1; |
368 | opterr = 1; | |
369 | optopt = '?'; | |
370 | ||
# | Line 427 | Line 388 | cmdline_parser_internal (int argc, char * const *argv, | |
388 | { "r_rcorr", 0, NULL, 0 }, | |
389 | { "thetacorr", 0, NULL, 0 }, | |
390 | { "drcorr", 0, NULL, 0 }, | |
391 | + | { "helfandEcorr", 0, NULL, 0 }, |
392 | { NULL, 0, NULL, 0 } | |
393 | }; | |
394 | ||
# | Line 595 | Line 557 | cmdline_parser_internal (int argc, char * const *argv, | |
557 | continue; | |
558 | local_args_info.order_given = 1; | |
559 | args_info->order_given = 1; | |
560 | < | args_info->order_arg = strtol (optarg, &stop_char, 0); |
599 | < | if (!(stop_char && *stop_char == '\0')) { |
600 | < | fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); |
601 | < | goto failure; |
602 | < | } |
560 | > | args_info->order_arg = strtol (optarg,&stop_char,0); |
561 | if (args_info->order_orig) | |
562 | free (args_info->order_orig); /* free previous string */ | |
563 | args_info->order_orig = gengetopt_strdup (optarg); | |
# | Line 650 | Line 608 | cmdline_parser_internal (int argc, char * const *argv, | |
608 | continue; | |
609 | local_args_info.drcorr_given = 1; | |
610 | args_info->drcorr_given = 1; | |
611 | + | if (args_info->dynamicProps_group_counter && override) |
612 | + | reset_group_dynamicProps (args_info); |
613 | + | args_info->dynamicProps_group_counter += 1; |
614 | + | break; |
615 | + | } |
616 | + | /* Helfand moment for thermal conductvity. */ |
617 | + | else if (strcmp (long_options[option_index].name, "helfandEcorr") == 0) |
618 | + | { |
619 | + | if (local_args_info.helfandEcorr_given) |
620 | + | { |
621 | + | fprintf (stderr, "%s: `--helfandEcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); |
622 | + | goto failure; |
623 | + | } |
624 | + | if (args_info->helfandEcorr_given && ! override) |
625 | + | continue; |
626 | + | local_args_info.helfandEcorr_given = 1; |
627 | + | args_info->helfandEcorr_given = 1; |
628 | if (args_info->dynamicProps_group_counter && override) | |
629 | reset_group_dynamicProps (args_info); | |
630 | args_info->dynamicProps_group_counter += 1; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |