--- trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2008/01/23 21:21:50 1213 +++ trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2008/05/27 16:39:06 1245 @@ -1,7 +1,7 @@ /* - File autogenerated by gengetopt version 2.19.1 + File autogenerated by gengetopt version 2.14 generated with the following command: - gengetopt -F DynamicPropsCmd + gengetopt -i DynamicProps.ggo -F DynamicPropsCmd The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -21,31 +21,6 @@ #include "DynamicPropsCmd.h" -const char *gengetopt_args_info_purpose = ""; - -const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]..."; - -const char *gengetopt_args_info_description = ""; - -const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -i, --input=filename input dump file", - " -o, --output=filename output file name", - " --sele1=selection script select first stuntdouble set", - " --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)", - " --order=INT Lengendre Polynomial Order", - "\n Group: dynamicProps\n an option of this group is required", - " -r, --rcorr rmsd", - " -v, --vcorr velocity correlation function", - " -d, --dcorr dipole correlation function", - " -l, --lcorr Lengendre correlation function", - " --r_rcorr Radial rmsd", - " --thetacorr Angular rmsd", - " --drcorr Directional rmsd for particles with unit \n vectors", - 0 -}; - static void clear_given (struct gengetopt_args_info *args_info); static @@ -77,6 +52,7 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->r_rcorr_given = 0 ; args_info->thetacorr_given = 0 ; args_info->drcorr_given = 0 ; + args_info->helfandEcorr_given = 0 ; args_info->dynamicProps_group_counter = 0 ; } @@ -95,26 +71,6 @@ void clear_args (struct gengetopt_args_info *args_info } -static -void init_args_info(struct gengetopt_args_info *args_info) -{ - args_info->help_help = gengetopt_args_info_help[0] ; - args_info->version_help = gengetopt_args_info_help[1] ; - args_info->input_help = gengetopt_args_info_help[2] ; - args_info->output_help = gengetopt_args_info_help[3] ; - args_info->sele1_help = gengetopt_args_info_help[4] ; - args_info->sele2_help = gengetopt_args_info_help[5] ; - args_info->order_help = gengetopt_args_info_help[6] ; - args_info->rcorr_help = gengetopt_args_info_help[7] ; - args_info->vcorr_help = gengetopt_args_info_help[8] ; - args_info->dcorr_help = gengetopt_args_info_help[9] ; - args_info->lcorr_help = gengetopt_args_info_help[10] ; - args_info->r_rcorr_help = gengetopt_args_info_help[11] ; - args_info->thetacorr_help = gengetopt_args_info_help[12] ; - args_info->drcorr_help = gengetopt_args_info_help[13] ; - -} - void cmdline_parser_print_version (void) { @@ -124,19 +80,25 @@ cmdline_parser_print_help (void) void cmdline_parser_print_help (void) { - int i = 0; cmdline_parser_print_version (); - - if (strlen(gengetopt_args_info_purpose) > 0) - printf("\n%s\n", gengetopt_args_info_purpose); - - printf("\n%s\n\n", gengetopt_args_info_usage); - - if (strlen(gengetopt_args_info_description) > 0) - printf("%s\n", gengetopt_args_info_description); - - while (gengetopt_args_info_help[i]) - printf("%s\n", gengetopt_args_info_help[i++]); + printf("\nUsage: DynamicProps [OPTIONS]...\n\n"); + printf("%s\n"," -h, --help Print help and exit"); + printf("%s\n"," -V, --version Print version and exit"); + printf("%s\n"," -i, --input=filename input dump file"); + printf("%s\n"," -o, --output=filename output file name"); + printf("%s\n"," --sele1=selection script select first stuntdouble set"); + printf("%s\n"," --sele2=selection script select second stuntdouble set (if sele2 is not \n set, use script from sele1)"); + printf("%s\n"," --order=INT Lengendre Polynomial Order"); + printf("%s\n","\n Group: dynamicProps\n an option of this group is required"); + printf("%s\n"," -r, --rcorr rmsd"); + printf("%s\n"," -v, --vcorr velocity correlation function"); + printf("%s\n"," -d, --dcorr dipole correlation function"); + printf("%s\n"," -l, --lcorr Lengendre correlation function"); + printf("%s\n"," --r_rcorr Radial rmsd"); + printf("%s\n"," --thetacorr Angular rmsd"); + printf("%s\n"," --drcorr Directional rmsd for particles with unit \n vectors"); + printf("%s\n"," --helfandEcorr Helfand moment for thermal conductvity"); + } void @@ -144,7 +106,6 @@ cmdline_parser_init (struct gengetopt_args_info *args_ { clear_given (args_info); clear_args (args_info); - init_args_info (args_info); } static void @@ -276,6 +237,9 @@ cmdline_parser_file_save(const char *filename, struct if (args_info->drcorr_given) { fprintf(outfile, "%s\n", "drcorr"); } + if (args_info->helfandEcorr_given) { + fprintf(outfile, "%s\n", "helfandEcorr"); + } fclose (outfile); @@ -322,6 +286,7 @@ reset_group_dynamicProps(struct gengetopt_args_info *a args_info->r_rcorr_given = 0 ; args_info->thetacorr_given = 0 ; args_info->drcorr_given = 0 ; + args_info->helfandEcorr_given = 0 ; args_info->dynamicProps_group_counter = 0; } @@ -370,13 +335,11 @@ cmdline_parser_required2 (struct gengetopt_args_info * { int error = 0; - /* checks for required options */ if (! args_info->input_given) { fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); error = 1; } - if (args_info->dynamicProps_group_counter == 0) { 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 : "")); @@ -384,8 +347,6 @@ cmdline_parser_required2 (struct gengetopt_args_info * } - /* checks for dependences among options */ - return error; } @@ -403,7 +364,7 @@ cmdline_parser_internal (int argc, char * const *argv, cmdline_parser_init (&local_args_info); optarg = 0; - optind = 0; + optind = 1; opterr = 1; optopt = '?'; @@ -427,6 +388,7 @@ cmdline_parser_internal (int argc, char * const *argv, { "r_rcorr", 0, NULL, 0 }, { "thetacorr", 0, NULL, 0 }, { "drcorr", 0, NULL, 0 }, + { "helfandEcorr", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; @@ -595,11 +557,7 @@ cmdline_parser_internal (int argc, char * const *argv, continue; local_args_info.order_given = 1; args_info->order_given = 1; - args_info->order_arg = strtol (optarg, &stop_char, 0); - if (!(stop_char && *stop_char == '\0')) { - fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); - goto failure; - } + args_info->order_arg = strtol (optarg,&stop_char,0); if (args_info->order_orig) free (args_info->order_orig); /* free previous string */ args_info->order_orig = gengetopt_strdup (optarg); @@ -650,6 +608,23 @@ cmdline_parser_internal (int argc, char * const *argv, continue; local_args_info.drcorr_given = 1; args_info->drcorr_given = 1; + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + break; + } + /* Helfand moment for thermal conductvity. */ + else if (strcmp (long_options[option_index].name, "helfandEcorr") == 0) + { + if (local_args_info.helfandEcorr_given) + { + fprintf (stderr, "%s: `--helfandEcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->helfandEcorr_given && ! override) + continue; + local_args_info.helfandEcorr_given = 1; + args_info->helfandEcorr_given = 1; if (args_info->dynamicProps_group_counter && override) reset_group_dynamicProps (args_info); args_info->dynamicProps_group_counter += 1;