--- trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2006/12/14 19:38:56 1098 +++ trunk/src/applications/dynamicProps/DynamicPropsCmd.c 2008/01/23 21:21:50 1213 @@ -1,7 +1,7 @@ /* - File autogenerated by gengetopt version 2.15 + File autogenerated by gengetopt version 2.19.1 generated with the following command: - gengetopt -i DynamicProps.ggo --file-name=DynamicPropsCmd + gengetopt -F DynamicPropsCmd The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -21,6 +21,31 @@ #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 @@ -50,6 +75,8 @@ void clear_given (struct gengetopt_args_info *args_inf args_info->dcorr_given = 0 ; args_info->lcorr_given = 0 ; args_info->r_rcorr_given = 0 ; + args_info->thetacorr_given = 0 ; + args_info->drcorr_given = 0 ; args_info->dynamicProps_group_counter = 0 ; } @@ -68,6 +95,26 @@ 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) { @@ -77,22 +124,19 @@ cmdline_parser_print_help (void) void cmdline_parser_print_help (void) { + int i = 0; cmdline_parser_print_version (); - 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"); - + + 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++]); } void @@ -100,6 +144,7 @@ cmdline_parser_init (struct gengetopt_args_info *args_ { clear_given (args_info); clear_args (args_info); + init_args_info (args_info); } static void @@ -224,7 +269,13 @@ cmdline_parser_file_save(const char *filename, struct } if (args_info->r_rcorr_given) { fprintf(outfile, "%s\n", "r_rcorr"); + } + if (args_info->thetacorr_given) { + fprintf(outfile, "%s\n", "thetacorr"); } + if (args_info->drcorr_given) { + fprintf(outfile, "%s\n", "drcorr"); + } fclose (outfile); @@ -269,6 +320,8 @@ reset_group_dynamicProps(struct gengetopt_args_info *a args_info->dcorr_given = 0 ; args_info->lcorr_given = 0 ; args_info->r_rcorr_given = 0 ; + args_info->thetacorr_given = 0 ; + args_info->drcorr_given = 0 ; args_info->dynamicProps_group_counter = 0; } @@ -317,11 +370,13 @@ 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 : "")); @@ -329,6 +384,8 @@ cmdline_parser_required2 (struct gengetopt_args_info * } + /* checks for dependences among options */ + return error; } @@ -346,7 +403,7 @@ cmdline_parser_internal (int argc, char * const *argv, cmdline_parser_init (&local_args_info); optarg = 0; - optind = 1; + optind = 0; opterr = 1; optopt = '?'; @@ -368,6 +425,8 @@ cmdline_parser_internal (int argc, char * const *argv, { "dcorr", 0, NULL, 'd' }, { "lcorr", 0, NULL, 'l' }, { "r_rcorr", 0, NULL, 0 }, + { "thetacorr", 0, NULL, 0 }, + { "drcorr", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; @@ -557,11 +616,45 @@ cmdline_parser_internal (int argc, char * const *argv, continue; local_args_info.r_rcorr_given = 1; args_info->r_rcorr_given = 1; + if (args_info->dynamicProps_group_counter && override) + reset_group_dynamicProps (args_info); + args_info->dynamicProps_group_counter += 1; + break; + } + /* Angular rmsd. */ + else if (strcmp (long_options[option_index].name, "thetacorr") == 0) + { + if (local_args_info.thetacorr_given) + { + fprintf (stderr, "%s: `--thetacorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->thetacorr_given && ! override) + continue; + local_args_info.thetacorr_given = 1; + args_info->thetacorr_given = 1; if (args_info->dynamicProps_group_counter && override) reset_group_dynamicProps (args_info); args_info->dynamicProps_group_counter += 1; break; } + /* Directional rmsd for particles with unit vectors. */ + else if (strcmp (long_options[option_index].name, "drcorr") == 0) + { + if (local_args_info.drcorr_given) + { + fprintf (stderr, "%s: `--drcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); + goto failure; + } + if (args_info->drcorr_given && ! override) + 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; + } break; case '?': /* Invalid option. */